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
Closed

cmd/go: support module path with port number #26912

henryykt opened this issue Aug 10, 2018 · 4 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@henryykt
Copy link

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 added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Aug 10, 2018
@ianlancetaylor ianlancetaylor modified the milestones: vgo, Go1.11 Aug 10, 2018
@ianlancetaylor
Copy link
Contributor

CC @rsc @bcmills

@bcmills
Copy link
Contributor

bcmills 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 as completed Aug 10, 2018
@bcmills
Copy link
Contributor

bcmills 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
Copy link
Author

ic. Thanks for the clarification.

@golang golang locked and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants