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: support module path with port number #26912

Closed
henryykt opened this issue Aug 10, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@henryykt
Copy link

commented Aug 10, 2018

Please answer these questions before submitting your issue. Thanks!

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

$ vgo version
go version go1.10.3 linux/amd64 vgo:devel +1b870077c8

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOOS="linux"

What did you do?

Run "vgo build" on a project with a module pointing to an internal bitbucket repository.

go.mod contains the following line:

replace mycompany.com/mymodule v0.0.0 => bitbucket.mycompany:7990/lib/mymodule v0.0.0-20170726040925-aae89c28e061

What did you expect to see?

Expected "vgo build" to succeed and produce an executable

What did you see instead?

"vgo build" fails with:

import "mycompany.com/mymodule": malformed module path "bitbucket.mycompany.com:7990/lib/mymodule": invalid char ':'

The same fails in go1.11beta3.

Note: this used to work in vgo before commit 2093985.

@gopherbot gopherbot added this to the vgo milestone Aug 10, 2018

@ianlancetaylor ianlancetaylor changed the title x/vgo: no longer support module path with port number cmd/go: support module path with port number Aug 10, 2018

@ianlancetaylor ianlancetaylor modified the milestones: vgo, Go1.11 Aug 10, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Aug 10, 2018

If you're using replace directives to give the module location, everyone who uses your module will have to replicate them. They aren't intended for redirecting import paths; that's what the <meta> tags described here are for:
https://tip.golang.org/cmd/go/#hdr-Remote_import_paths

@bcmills bcmills closed this Aug 10, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Aug 10, 2018

Module paths identify modules, which can be fetched by a number of different protocols (including proxies). Port numbers would put too much of the internals of the distribution mechanism in the path.

@henryykt

This comment has been minimized.

Copy link
Author

commented Aug 10, 2018

ic. Thanks for the clarification.

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.