gotools.bash prints Go tools that can be updated.
By default, it checks tools in the Go tool's default go install location, so that you can go install $(gotools.bash). (It turns out that this doesn't actually work, though, you need to do something like for cmd in $(gotools.bash); do go install -v $cmd; done instead.)
Since the go install location is $GOBIN, you can choose a different location to check by invoking like GOBIN=/usr/local gotools.bash.
There are two senses of "can be updated" that the script checks for.
If a tool was built with a different version of Go than go, the script suggests reinstalling it at its current version.
Otherwise, if the configured module proxy reports a different version as the latest than the installed version of the command, the script suggests reinstalling it with the reported latest version.
The script directly queries the first element of GOPROXY as the source of truth on latest versions.
That module proxy must implement the optional $base/$module/@latest endpoint.
gotools.bash is a script that I wrote in under an hour on a whim. It is not robust. Use with care.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.