r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.35k stars 160 forks source link

Re-add the Go step via go-global-update #823

Closed qcloutier closed 2 years ago

qcloutier commented 2 years ago

go-global-update (https://github.com/Gelio/go-global-update) is a small tool to update all executables installed in a user's GOBIN, effectively providing a go get -u all replacement for Go 1.16+.

Since it appears that Go will not be receiving a built-in way to do this in the near future, this could be a good option in the meantime.

Standards checklist:

If you developed a feature or a bug fix for someone else and you do not have the means to test it, please tag this person here.

r-darwish commented 2 years ago

I was looking into reimplementing the Go step myself and tried to figure out what's the correct solution for Go 1.16. I'm happy to see that someone made a tool for that, but at the moment I prefer only adding tools that gain some popularity. This specific project has 0 stars, so I'm looking for a tool which is considered more mainstream.

qcloutier commented 2 years ago

Yeah, that's understandable. What are your thoughts on implementing the process in Topgrade itself? Effectively, it's just a matter of running go version -m (to get the source url) and go install <url>@latest on each item in the user's GOBIN. I think it's foolproof, but there could be some gotchas.

jasikpark commented 2 years ago

I am interested in this being solved! It seems like go-global-update would be pretty simple to reproduce in rust

https://github.com/Gelio/go-global-update/blob/a6ed616686f3d49c1ba5d0c9119974d30bd8d5d7/main.go#L1-L98

r-darwish commented 2 years ago

Still debating on this. It's possible to implement this logic in Topgrade itself but it feels like reinventing the wheel. On the other hand, go-global-update doesn't seem popular at all. I still don't understand how people in the Go community don't care enough about this issue to make sure a semi-official solution for this would exist.

jasikpark commented 2 years ago

I suppose users will either find the go-global-update on their own or find this PR when looking into how Topgrade supports Go? Or is there a list somewhere in the docs that describes which package managers are currently supported?

Gelio commented 2 years ago

I've just found this PR and I'm super humbled and excited to see my project having an opportunity to be used in a well-known tool! Thank you for the opportunity

@jasikpark Looking at the wiki, there's this page that seems to be listing all the steps topgrade goes through, so I suppose go-global-update could be added there after this PR lands