-
Notifications
You must be signed in to change notification settings - Fork 250
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
goenv local does not take effect? #209
Comments
This is a configuration issue -- you shouldn't be blindly prepending |
It looks like the offending lines came from the README -- it looks like this feature is not that well thought-out and potentially breaks stuff badly. I personally don't use |
Yes I think that's because using the |
I found my way here for this exact reason. Use pyenv on a daily basis so expecting goenv to function similarly. Following the instructions I added this in my zsh setup:
This results in the same issue OP describes. Removing the exports from my if block like so
results the correct behavior I was looking for.
|
Whats going on guys? We experienced the same issue and we had this in bash as instructed by INSTALL.md
Removing the bottom two line solves the issue, at least it looks like solved for now. What is the correct behavior? If these lines are not needed, then why INSTALL.md tells (and says its recommended) you to add these? @neersighted @debo |
I'm having the same problem and commenting the lines won't fix it for me. I tried to install |
The ❯ go version
go version go1.19.3 darwin/amd64
❯ goenv local 1.19.4
❯ go version
go version go1.19.3 darwin/amd64
❯ exec $SHELL
❯ go version
go version go1.19.4 darwin/amd64 |
I know i'm kinda necro-bumping, but I fiddled a bit more today and ended up with this in bashrc export GOENV_ROOT="$HOME/.goenv"
export PATH="$PATH:$GOENV_ROOT/bin"
eval "$(goenv init -)"
unset GOROOT
unset GOPATH I'm unsetting GOROOT and GOPATH because those values are only set at init. And as I navigate through different go version enabled directories, those env variables becomes wrong, so they become a source of confusion. unsetting them solves the confusion. As I'm not putting not putting $GOPATH/bin,$GOROOT/bin in PATH, there is no conflict. all go commands are run by goenv shims, shims set the correct GOPATH/GOROOT env just before executing. |
Reproducible Steps:
In the same shell:
goenv versions system 1.14.4 1.15.15 * 1.16.8 (set by /Users/codinghuang/codeDir/wiki/k8s-operator/docs/.go-version) 1.17.1
In the same shell:
other info:
The text was updated successfully, but these errors were encountered: