projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e7d0d5
)
9005: Fix missing error checks.
author
Tom Clegg <tom@curoverse.com>
Fri, 19 May 2017 19:55:40 +0000
(15:55 -0400)
committer
Tom Clegg <tom@curoverse.com>
Fri, 19 May 2017 20:06:17 +0000
(16:06 -0400)
sdk/go/keepclient/hashcheck.go
patch
|
blob
|
history
diff --git
a/sdk/go/keepclient/hashcheck.go
b/sdk/go/keepclient/hashcheck.go
index 1706134757fae14a6cc0f0ccecc1a7b6a46a3002..b97df78d96da1e8e196e40adfa7773b1eb467b5c 100644
(file)
--- a/
sdk/go/keepclient/hashcheck.go
+++ b/
sdk/go/keepclient/hashcheck.go
@@
-63,8
+63,14
@@
func (this HashCheckingReader) WriteTo(dest io.Writer) (written int64, err error
func (this HashCheckingReader) Close() (err error) {
_, err = io.Copy(this.Hash, this.Reader)
- if closer, ok := this.Reader.(io.ReadCloser); ok {
- err = closer.Close()
+ if closer, ok := this.Reader.(io.Closer); ok {
+ err2 := closer.Close()
+ if err2 != nil && err == nil {
+ return err2
+ }
+ }
+ if err != nil {
+ return err
}
sum := this.Hash.Sum(make([]byte, 0, this.Hash.Size()))