Down with the sickness (AUTO_GOPATH)#48958
Conversation
8bacbb9 to
58ab44b
Compare
tianon
left a comment
There was a problem hiding this comment.
This is sane, but honestly removing all this code would be too IMO (assuming we go build with -mod but IIRC we aren't quite there yet?)
|
(to be clear, I'm a big fan of |
|
Yeah, I locally have symlinked I guess we could even add that as extra condition (instead of erroring) ("is there a |
| fi | ||
|
|
||
| if [ ! "$GOPATH" ]; then | ||
| if [ ! "$GOPATH" ] && [ ! "$(go env GOPATH)" ]; then |
There was a problem hiding this comment.
Silly question; wouldn't the first check be redundant? (i.e., wouldn't go env GOPATH reflect GOPATH (if set)?)
There was a problem hiding this comment.
LOL, actually wondering now if it's possible to not have GOPATH;
root@f0c269d1aafd:/go# printenv GOPATH
/go
root@f0c269d1aafd:/go# go env GOPATH
/go
root@f0c269d1aafd:/go# export GOPATH=/foo/bar
root@f0c269d1aafd:/go# go env GOPATH
/foo/bar
root@f0c269d1aafd:/go# unset GOPATH
root@f0c269d1aafd:/go# go env GOPATH
/root/gowondering now if the check .. actually checks for what it was meant to check; given that go env GOPATH always returns a value, and if no custom path is set, it uses default (~/go/), it would never be "true"?
Wondering if the check was originally meant to say “as long as it’s not the default (because of vendoring when it was not a thing yet)?). If that’s not the case, wondering if the check is even needed (if it would pick a default if not set)
There was a problem hiding this comment.
I agree, I think I was just keeping it because it already existed.
I have removed this.
this won't actually work as-is because go env GOPATH will always return a non-empty value 🙈
58ab44b to
9270df6
Compare
Go has a nice tool to inspect the currently set (or default) `GOPATH` with `go env GOPATH`. We should do that rather than absolutely requiring people to manually set `GOPATH` or use the `AUTO_GOPATH`. This doesn't actually remove `AUTO_GOPATH`, people can still use it. Signed-off-by: Brian Goff <[email protected]>
9270df6 to
ce37cb3
Compare
Go has a nice tool to inspect the currently set (or default)
GOPATHwithgo env GOPATH.We should do that rather than absolutely requiring people to manually set
GOPATHor useAUTO_GOPATH.This doesn't actually remove
AUTO_GOPATH, people can still use it.