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
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@shoenig
Copy link
Contributor

shoenig 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 the NeedsFix The path to resolution is known, but the work has not been done. label Sep 3, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Sep 3, 2018
@unicod3
Copy link

unicod3 commented Oct 28, 2018

it seems that solved at #27279

@agnivade
Copy link
Contributor

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

@golang golang locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants