-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: cmd/go: manage binaries installed in GOBIN #50261
Comments
this could also make the vim-go binary installation simpler |
This can be done with external tooling, for example https://github.com/kortschak/ugbt/. |
go install
will have a --list-outdated
flag
Searched external tooling for a while and didn't find this. I'll try it out and report back 😀 |
If go clean -i does not do this already then it should. |
I forgot to report back. the tool works great! |
@beoran not sure how your comment is related to the issue, but if you meant:
for deleting what was installed via gobin it didn't work. |
Found one https://github.com/nao1215/gup (an external tool) |
not as heavy into go binaries now, but if others think that |
I thought I'd add my 2c to this issue: I have a script that reinstalls a set of tools I use regularly at their latest (or master/main, depending on each case) versions. It's much dumber than the other kinds of automatic tools proposed here, but I'm fine with that. Every now and then I'll delete my entire GOBIN, so any tools that I installed once and miss, I add to the script so they are reinstalled and kept up to date. |
I think it would make sense if I have my own program that does what I expect |
It would be nice to have something like:
It seems like
It seems like an
|
This conflates the role of the go tool (as a collection of compiler tools) with a package manager. |
With go mod that ship already has sailed. Ten years ago the go command only was a compiler. Now the go command also includes a module manager, and go install is a binary manager. |
We should leave this to external tools. The go command does have a module system, and I do think it makes sense to manage things on a module level: the user defined For example, it's not clear what we do when the binaries in GOBIN were not built using "go install pkg@version", and it's a bit complex to determine when that is the case. For example, does the build graph have to be exactly the same, or is it okay if the build was done from a module where the required version of the module providing I think there's a (only slightly awkward) way to manage global tools using the I'm going to close this issue, but I don't want to completely rule this out. I do think that we should discuss specific proposals in new issues that are created for them. I'll re-open #71351 as one of those specific proposal issues. |
As a user, I would like to have a command that iterates through my $GOBIN and checks if all of the packages I installed are in their latest version.
the new
go install
command is great and allows installing the binaries without changing anything on the machine.some solutions I can see in mind for this:
go.mod
or a section insidego.mod
that relates to binaries sogo list
can display them and then can be easily iterated on.go_install.mod
specific for this solutiongo install
will read it when using the--list-outdated
flagthis issue comes from the fact I have an
update
command that upgrades all of the components on my machine fairly frequently and rust has https://github.com/nabijaczleweli/cargo-update for that caseThe text was updated successfully, but these errors were encountered: