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: remove go get's hostname check? #19923

Closed
instance-oom opened this issue Apr 11, 2017 · 8 comments
Closed

cmd/go: remove go get's hostname check? #19923

instance-oom opened this issue Apr 11, 2017 · 8 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.

Comments

@instance-oom
Copy link

Please answer these questions before submitting your issue. Thanks!

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

1.8.1

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

windows and amd64

What did you do?

When using go get command to get a package from private gitlab repo like https://gitlab2, this repo's url not contains . . Then i got the error import path does not begin with hostname.

What did you expect to see?

Can we remove the hostname check? https://github.com/golang/go/blob/master/src/cmd/go/internal/get/vcs.go#L659-L662

What did you see instead?

@mvdan
Copy link
Member

mvdan commented Apr 11, 2017

I think this is by design throughout go get. See the "remote import paths" section in go help importpath. Are you suggesting to change go get's design?

@bradfitz bradfitz changed the title go get: remove hostname check? cmd/go: remove go get's hostname check? Apr 11, 2017
@bradfitz bradfitz added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 11, 2017
@bradfitz
Copy link
Contributor

gitlab1 didn't work out well? :)

Did you consider using names like "git.yourcorp.com"? That's more idiomatic Go.

@instance-oom
Copy link
Author

Yes. The hostname like 'git.yourcorp.com' is more idiomatic. But sometimes this is not what we can decide, especially in the internal network. And the check rule just checked that whether the hostname contains '.'. simple?

@mvdan , @bradfitz Thanks anyway!

@spiritedsnowcat
Copy link

This has also impacted my workplace. For a local server, the hostname "sw" isn't permitted but is a valid import path for a hosted gitlab server. I would like to see this check and the redirection check on the import path removed. I don't get why there are so many unnecessary checks on "go get".

@mattn
Copy link
Member

mattn commented Apr 12, 2017

If removing dot, the name will be treated as standard package. If you write hostname encoding into your /etc/hosts, go will have to git clone encoding/json with importing encoding/json.

@instance-oom
Copy link
Author

So at present, the only way is use git clone then run go install

@mattn
Copy link
Member

mattn commented Apr 12, 2017

Yes, but I can't say for sure if you use anothor tools.

@instance-oom
Copy link
Author

Most tools is also use go get to get packages. It's not easy. But thanks anyway!

@golang golang locked and limited conversation to collaborators Apr 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

6 participants