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 install file.go should not work if GOBIN is set #6192

Closed
robpike opened this issue Aug 20, 2013 · 4 comments
Closed

cmd/go: go install file.go should not work if GOBIN is set #6192

robpike opened this issue Aug 20, 2013 · 4 comments
Milestone

Comments

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

wally=% GOBIN= go install doc.go
go install: no install location for directory /private/tmp outside GOPATH
wally=% GOBIN=/Users/r/bin/ go install doc.go
wally=% 


The existence of GOBIN should not suddenly make this erroneous usage work. (Yes, it
installs the program, a one-source-file command, into /Users/r/bin as requested).
@rsc
Copy link
Contributor

rsc commented Sep 10, 2013

Comment 1:

Earlier me disagrees. I actually implemented what you asked for, but there is a test in
go/test.bash checking that go install succeeds in this case, and my change broke that
test. Especially since the behavior is tested, I am inclined to leave it as is.

@rsc
Copy link
Contributor

rsc commented Sep 10, 2013

Comment 2:

I should note that CL 13234052 fixes the error so that instead of
being told about "outside GOPATH" it says 
    go install: no install location for .go files listed on command line (GOBIN not set)
That at least should make the different behavior very clear.

Status changed to WorkingAsIntended.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@pandeya
Copy link

pandeya commented Apr 21, 2015

Hi,
My GOPATH env variable is correctly set. My PATH env var includes $GOPATH/bin. I also have $GOPATH/bin created. I have a source file inside $GOPATH/src/github.com/pandeya/hello/hello.go

When I run command "go install hello.go" in hello directory, I get the above mentioned error message

go install: no install location for .go files listed on command line (GOBIN not set)

I can run the program using "go run hello.go" properly.

I understand that if I have GOPATH correctly set, i don't need to set GOBIN.

Am I missing anything?

I am running OS X Yosemite 10.10.3 with go1.4.2 darwin/amd64

Thanks.

@ianlancetaylor
Copy link
Contributor

This issue was closed in 2013. Please don't ask questions on closed issues. Please ask them on the mailing list golang-nuts@googlegroups.com. Thanks.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants