goenv icon indicating copy to clipboard operation
goenv copied to clipboard

go doesn't work if have `/usr/bin/go`

Open atomita opened this issue 2 years ago • 5 comments
trafficstars

https://github.com/syndbg/goenv/issues/247 moved the shims directory to the end of the PATH, so go doesn't work if have /usr/bin/go.

# the shims directory to the end of the PATH
which go
/usr/bin/go
# the shims directory to the start of the PATH
which go
~/.anyenv/envs/goenv/shims/go

atomita avatar Dec 20 '22 14:12 atomita

@atomita I stopped installing /usr/bin/go on any build machine when I started using goenv years ago -- too many opportunities for confusion if it's left in place. Removing your system Go would be my recommendation. Is there a reason that can't be done on your platform?

stevegt avatar Feb 03 '23 23:02 stevegt

Maybe goenv should check if there is a "system" version and warn about the behavioral PATH collision?

ChronosMasterOfAllTime avatar Feb 19 '23 05:02 ChronosMasterOfAllTime

Future folks who find this thread -- please see https://github.com/syndbg/goenv/issues/247#issuecomment-1460643733.

@ChronosMasterOfAllTime That may not be a bad idea -- I don't have the bandwidth to think through if or how it would work. Are you volunteering? ;-)

Otherwise something in the README might be in order -- I just spotted #289; there will likely be others.

stevegt avatar Mar 08 '23 18:03 stevegt

@ankitcharolia our version doesn't have a dependency on go or Python. It uses native shell which makes it more portable.

ChronosMasterOfAllTime avatar Aug 24 '23 11:08 ChronosMasterOfAllTime

goenv should override the system go. But not require it removed.

I had to remove it, and each time I play with my package manager in debian, I fear a chain of dependencies breaking. Luckily, not much dependencies. But you never know when some random install or script pulls in the go dependency back.

So, really, it should not be a "just remove the system go" "solution"... goenv should override the system go.

gl-yziquel avatar May 27 '24 16:05 gl-yziquel