Re:Go 1.24's go tool is one of the best additions to the eco...
by jchw on Wednesday January 29, 2025 @08:59AM
(#42864934)
A simpler approach is to use `go run` with a specific version. e.g.:
go run github.com/golangci/golangci-lint/cmd/[email protected] run
Easy enough to stuff in a Makefile or whatever.Even better in Go 1.24 since according to this article the invocations of go run will also be cached (rather than just utilizing the compilation cache.) So there shouldn't be much of an advantage to pre-emptively installing binaries anymore versus just go running them.
Re:Go 1.24's go tool is one of the best additions to the eco...
by jamietanna on Wednesday January 29, 2025 @04:11PM
(#42871204)
Interesting - would something like `make lint` (which then installs to `$PWD/bin`) work? That's how I've been doing it on the projects I've been working on, and it's worked nicely - including automated updates via Renovate (https://www.jvt.me/posts/2022/12/15/renovate-golangci-lint/)
Having the wrong version installed between collaborators is problematic as then they may get different results and spend time wondering why.
Works across branches and projects.