mirror of https://github.com/golang/go.git
only overwrite err with closeErr if err is nil and closeErr is non nil
This commit is contained in:
parent
1fc6c8e049
commit
354ef1d29e
|
|
@ -332,7 +332,7 @@ func hashZip(mod module.Version, zipfile, ziphashfile string) (err error) {
|
|||
return err
|
||||
}
|
||||
defer func() {
|
||||
if closeErr := hf.Close(); err != nil {
|
||||
if closeErr := hf.Close(); err == nil && closeErr != nil {
|
||||
err = closeErr
|
||||
}
|
||||
}()
|
||||
|
|
|
|||
Loading…
Reference in New Issue