cmd/go/internal/modfetch: do not panic when zip is incorrect

Fixes #26536

Change-Id: I75d284bd39af0a06e31d18c7f7745c5a8ecbe6ac
GitHub-Last-Rev: 88040a9edb
GitHub-Pull-Request: golang/go#26537
Reviewed-on: https://go-review.googlesource.com/125436
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
marwan-at-work 2018-07-22 20:23:29 +00:00 committed by Brad Fitzpatrick
parent 30d7e6449f
commit 62f401bf18
1 changed files with 0 additions and 1 deletions

View File

@ -90,7 +90,6 @@ func downloadZip(mod module.Version, target string) error {
// Double-check zip file looks OK.
z, err := zip.OpenReader(tmpfile)
if err != nil {
z.Close()
return err
}
prefix := mod.Path + "@" + mod.Version