[Bug] - Installing Golang wipes out go-installed apps from path
HacDan opened this issue · 3 comments
What were you trying to install (or what else went wrong)?
go (1.22.3) but I doubt version matters here
What exactly did you do?
webi go
What went wrong?
wiped out all go install
ed software from my path
Which OS did you try on?
PopOS
- Mac
- Windows
- Linux
What type of computer (i.e. laptop, desktop, Raspberry Pi)?
- Laptop or Desktop (amd64 / x86-64)
- Raspberry Pi (ARM-64)
- Other (please specify, if you know)
I just happened to notice after updating to go 1.22 that I no longer had access to any software I had installed with go install. My previous install of Go was from webi
and I used webi go
to update my currently installed version of Go. I'm assuming this is just due to a path change, but figured it was at least worth reporting. This may be how things work when updating Go in other manners, I have not researched further.
This isn't a bug, it's part of the no-conflict guarantee.
Whatever is installed by a particular version of Go remains with that version of Go.
The reason for this is primarily just because that's the way the Go folders are set up. However, it's also helpful for the rare case when breaking changes require switching versions.
If you want to preserve a particular binary, move it from ~/go/bin/
(which is a symlink to ~/.local/opt/go-bin-vX.Y.Z/
) to ~/bin
(and make sure that ~/bin/
is in your PATH
).
I guess I'm at a loss as why this is part of the no-conflict guarantee. Binaries installed with go install are statically compiled and not go version dependent. I understand this is a consequence of folder layout, just don't see this as expected behavior.
Typically the things you go install
are development tools - things like stringer
, goimports
, etc.
From that perspective, it makes sense to have the tools and compiler in sync.
Non-dev go binaries are typically installed with... y'know, Webi - or brew or the GoReleaser script.
What's your use case?