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: trouble using go-import's mod vcs with a custom import path #34445
Comments
shouldn't it be more like:
|
@seankhliao No, it doesn't work like that. It's because x should be a prefix of the given import path to
|
But afaik GitHub urls receive special treatment (making ?go-get=1) unnecessary, so if you want to change the import behavior you need a vanity url |
I've tested it with a GitHub url too and in all cases, it goes to the mentioned condition. |
@erbesharat, only the server at Do you have a concrete example of this problem using your own server on a domain that you control? |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I used this go-import tag in response to
go get
so I can use my custom proxy server to fetch the package and use it by the vanity URL, not the real package's import path.What did you expect to see?
I expected to receive the mod requests (list, etc.) from
go get
onhttps://example.test/modproxy
.What did you see instead?
The
mod
meta tag gets skipped andgo get
uses thegit
vcs tag. Because the import path is not the same as the meta tag's prefix, it goes into this condition:https://github.com/golang/go/blob/master/src/cmd/go/internal/get/vcs.go#L985
The text was updated successfully, but these errors were encountered: