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: GOBIN requires an absolute path but isn't documented to. #12907

Closed
dmitshur opened this issue Oct 12, 2015 · 4 comments
Closed

cmd/go: GOBIN requires an absolute path but isn't documented to. #12907

dmitshur opened this issue Oct 12, 2015 · 4 comments

Comments

@dmitshur
Copy link
Contributor

I'm using go version go1.5.1 darwin/amd64.

I've tried:

$ GOBIN=. go install
$ echo $?
0
$ ./foo
-bash: ./foo: No such file or directory

And the process exited with status 0 (success), but there was nothing written to current folder.

When I used an absolute path for GOBIN, it worked as expected:

$ GOBIN=`pwd` go install
$ echo $?
0
$ ./foo

From https://tip.golang.org/cmd/go/:

If the GOBIN environment variable is set, commands are installed to the directory it names instead of DIR/bin.

GOBIN - The directory where 'go install' will install a command.

As far as I can tell, nothing in documentation mentions it must be an absolute path. Yet it doesn't work when the path is relative.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Oct 12, 2015
@adg
Copy link
Contributor

adg commented Oct 12, 2015

It should be documented and the go command should issue an error when it is set to a relative path.

@dmitshur
Copy link
Contributor Author

That sounds like a reasonable way to resolve this issue.

@gopherbot
Copy link

CL https://golang.org/cl/15755 mentions this issue.

@rakyll rakyll self-assigned this Oct 12, 2015
@rakyll rakyll closed this as completed in 5b9c6b9 Oct 12, 2015
@dmitshur
Copy link
Contributor Author

Thank you for fixing this!

@golang golang locked and limited conversation to collaborators Oct 12, 2016
@rsc rsc unassigned rakyll Jun 23, 2022
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