Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's the use case you have over "just" using the official install process (`curl | sh`)?


As long as a team agrees to have .golangci-version as the source of truth, the people using the tool don't have to worry about having the right version installed, as the wrapper fetches it on demand.

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.


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/)


A simpler approach is to use `go run` with a specific version. e.g.:

    go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: