-
Notifications
You must be signed in to change notification settings - Fork 18k
go/build: should package be aware of GOBIN? #4891
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
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Currently all handling of the GOBIN environment variable is in cmd/go. Another (perhaps better) approach would be to add a GOBIN field to go/build's Context, and have the handling done there. If the GOBIN field is empty it should be ignored, preserving backward compatibility with 1.0. Although if defaultContext pulls the GOBIN from the environment, this potentially breaks backward compat, although it's arguably a bug fix. In summary, I'm inclined to support adding a GOBIN field to go/build's Context, and removing the GOBIN handling from cmd/go. What say Russ? Labels changed: added priority-later, removed priority-triage. Status changed to Accepted. |
I have made some changes (attached diff) that yield the expected results for go/build.. Added the GOBIN field in go/build's Context. I also tried to removing the GOBIN handling from cmd/go. However, the go tool still checks and applies GOBIN in some situations outside the BinDir field from go/build's Package. So I'm not fully satisfied with this patch, but it might be a good indication and/or be used for backward compatibility tests. Attachments:
|
It's been a while and I thought I'd pick this up again. I've made the changes to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
The text was updated successfully, but these errors were encountered: