Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: error message for incorrect downloaded zip truncates last character of prefix #27478

Closed
shoenig opened this issue Sep 3, 2018 · 2 comments

Comments

Projects
None yet
5 participants
@shoenig
Copy link
Contributor

commented Sep 3, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

$ go version
go version go1.11 linux/amd64

What did you do?

Created an incorrectly structured .zip file served up via GOPROXY. Noticed the error message regarding the proper file prefix within the zip is truncating the last character of the expected prefix name.

minifiers/minifiers.go:27:2: unknown import path "github.com/tdewolff/minify": zip for github.com/tdewolff/minify@v2.3.5+incompatibl has unexpected file github.com/tdewolff/minify@v2.3.5/.gitignore
minifiers/minifiers.go:28:2: unknown import path "github.com/tdewolff/minify/css": zip for github.com/tdewolff/minify@v2.3.5+incompatibl has unexpected file github.com/tdewolff/minify@v2.3.5/.gitignore
minifiers/minifiers.go:29:2: unknown import path "github.com/tdewolff/minify/html": zip for github.com/tdewolff/minify@v2.3.5+incompatibl has unexpected file github.com/tdewolff/minify@v2.3.5/.gitignore
...

e.g. zip for github.com/tdewolff/minify@v2.3.5+incompatibl has unexpected file is missing the last e in incompatible

I don't know why the source code is explicitly chopping off the last character - maybe it was assumed to be cleaning up a trailing slash:
https://github.com/golang/go/blob/master/src/cmd/go/internal/modfetch/fetch.go#L126

@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Sep 3, 2018

@bcmills bcmills added the help wanted label Oct 25, 2018

@unicod3

This comment has been minimized.

Copy link

commented Oct 28, 2018

it seems that solved at #27279

@agnivade

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

@unicod3 - Thanks for spotting it ! Indeed it looks fixed.

@agnivade agnivade closed this Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.