Skip to content

Conversation

@lox
Copy link

@lox lox commented Oct 25, 2025

Pinned golangci-lint as a Go tool so my first contribution wouldn’t turn into a hunt for the "right" version instead of actual code, and in the process captured its whole dependency graph to keep lint runs hermetic and reproducible for everyone.

The exact commands are:

go get -tool github.com/golangci/golangci-lint/v2/cmd/[email protected]
go tool golangci-lint run ./...

Because it causes so much churn to go.mod, I'd suggest a core contributor verify the changes!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golangci-lint is a huge dependency. I wonder if it’s viable to extract tools into a separate Go module.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need a wrapper script, at which point might be easier to use https://github.com/cashapp/hermit for bin/golangci-lint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hard is it to just install version 2.1.0 of golangci-lint?

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.0

Having a task which does that, to setup a dev environment, might be nice. However, users of Task don't want to install all those modules.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a huge pain to have to swap your version of golangci-lint for every go project you use.

Agree the mod changes are heavy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants