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

campoy opened this Issue Jul 25, 2014 · 3 comments


None yet
6 participants

campoy commented Jul 25, 2014

What steps will reproduce the problem?
1. ~/bug.go contains any program compiling successfully (e.g.
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.

This comment has been minimized.


ianlancetaylor commented Aug 1, 2014

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

@rsc rsc removed release-none labels Apr 10, 2015


This comment has been minimized.

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, 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


This comment has been minimized.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment