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: go get emits an error when given a repository ending with .go #18484

Closed
ghost opened this issue Jan 1, 2017 · 3 comments
Closed

cmd/go: go get emits an error when given a repository ending with .go #18484

ghost opened this issue Jan 1, 2017 · 3 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@ghost
Copy link

ghost commented Jan 1, 2017

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

go version go1.8beta2 linux/amd64

What did you do?

go get github.com/tumblr/tumblr.go

What did you expect to see?

go get silently cloned the repository.

What did you see instead?

go get cloned the repository and emitted an error message:

stat github.com/tumblr/tumblr.go: no such file or directory
@robpike
Copy link
Contributor

robpike commented Jan 1, 2017

I agree it's not handling this well. You should get an error up front and no download, I would think.

But whatever the resolution, putting .go on the end of a repository name is sure to cause lots of problems. Too many programs look for .go (or .c or .java or .py or ...) and assume items named like that are program source files. It would be wise to avoid fighting that assumption. Choose a different name.

@ghost
Copy link
Author

ghost commented Jan 3, 2017

But arguments to go get cannot be files, can they?
I personally don't mind the message as long as go get works, but it can confuse others.

@rakyll rakyll added this to the Go1.9Maybe milestone Jan 3, 2017
@bradfitz bradfitz modified the milestones: Go1.9Maybe, Go1.10 Jul 20, 2017
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Nov 10, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Dec 1, 2017
@rsc
Copy link
Contributor

rsc commented Apr 18, 2018

Arguments to go get can be files or local directories. Saying "go get ." means get all the things imported by the current directory. Saying "go get -u ." updates those things. The same for "go get x.go" and "go get -u x.go".

The answer is not to name repositories ending in .go.

@rsc rsc closed this as completed Apr 18, 2018
@golang golang locked and limited conversation to collaborators Apr 18, 2019
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