Skip to content
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

Open
georgettica opened this issue Dec 19, 2021 · 8 comments
Open

proposal: cmd/go: manage binaries installed in GOBIN #50261

georgettica opened this issue Dec 19, 2021 · 8 comments

Comments

@georgettica
Copy link

georgettica commented Dec 19, 2021

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:

  1. have a similar solution of go.mod or a section inside go.mod that relates to binaries so go list can display them and then can be easily iterated on.
  2. create a new go_install.mod specific for this solution
  3. add metadata in the $GOBIN folder on what binary version was installed and the go install will read it when using the --list-outdated flag
  4. other

this 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 case

@gopherbot gopherbot added this to the Proposal milestone Dec 19, 2021
@georgettica
Copy link
Author

georgettica commented Dec 19, 2021

this could also make the vim-go binary installation simpler
https://github.com/fatih/vim-go/blob/585e12d32b3a1defcf863bd405b440cefbd4e31a/plugin/go.vim#L78

@kortschak
Copy link
Contributor

kortschak commented Dec 19, 2021

This can be done with external tooling, for example https://github.com/kortschak/ugbt/.

@seankhliao seankhliao changed the title proposal: cmd/go/internal/work/build: go install will have a --list-outdated flag proposal: cmd/go: manage binaries installed in GOBIN Dec 19, 2021
@georgettica
Copy link
Author

georgettica commented Dec 19, 2021

Searched external tooling for a while and didn't find this.

I'll try it out and report back 😀

@beoran
Copy link

beoran commented Mar 16, 2022

If go clean -i does not do this already then it should.

@georgettica
Copy link
Author

georgettica commented Mar 16, 2022

I forgot to report back. the tool works great!
collaborated with @kortschak on it and created https://github.com/georgettica/ugbt-update-all-gobin to accomodate my own needs

@georgettica
Copy link
Author

georgettica commented Mar 16, 2022

@beoran not sure how your comment is related to the issue, but if you meant:

go clean -i ${GO_REPO_NAME}@${GO_REPO_VERSION}

for deleting what was installed via gobin it didn't work.

@phanirithvij
Copy link

phanirithvij commented Oct 25, 2022

Found one https://github.com/nao1215/gup (an external tool)

@georgettica
Copy link
Author

georgettica commented Oct 26, 2022

not as heavy into go binaries now, but if others think that gup is more mature than ugbt I'll switch my stuff there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

5 participants