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 fails when given source file path #8424

Closed
campoy opened this issue Jul 25, 2014 · 4 comments
Closed

cmd/go: go install fails when given source file path #8424

campoy opened this issue Jul 25, 2014 · 4 comments

Comments

@campoy
Copy link
Contributor

campoy commented Jul 25, 2014

What steps will reproduce the problem?
1. ~/bug.go contains any program compiling successfully (e.g.
http://play.golang.org/p/RQT4BfIN7h)
2. go install ~/bug.go

Reading the documentation of "go install" I expect it to fail because ~/bug.go
is not an import path.

Instead this error message is logged: "go install: no install location for .go
files listed on command line (GOBIN not set)"

In any case there's a documentation in the bug, since there's no mention $GOBIN.

Once the expected behavior clarified I'm happy to try to fix it.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-none.

@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc removed the install label Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@carstn
Copy link

carstn commented Sep 14, 2015

The same incorrect error message is outputted when you go install some .go file that doesn't contain a main package.

For example, if you run go install mgorus.go on github.com/weekface/mgorus, the compiler complains:
go install: no install location for .go files listed on command line (GOBIN not set).
This doesn't describe the correct problem. The problem is that you can install only main packages, not that GOBIN is not set (echo $GOBIN returns /Users/carstn/Code/go/bin).

current go version and os: go1.5 darwin/amd64

@coltin
Copy link

coltin commented Nov 12, 2015

@carstn is correct, I'm seeing the same thing. I tried to install a library with GOBIN set and I get this error message.

$ go version
go version go1.5.1 darwin/amd64

@bcmills
Copy link
Contributor

bcmills commented Jan 23, 2019

#23439 is a duplicate of this, but has quite a bit more discussion. Consolidating into that issue.

@bcmills bcmills closed this as completed Jan 23, 2019
@golang golang locked and limited conversation to collaborators Jan 23, 2020
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

8 participants