Skip to content

Error on add a custom plugin in golangci-lint #4345

Answered by ldez
hobbitx asked this question in Q&A
Discussion options

You must be logged in to vote

@hobbitx, the plugins of golangci-lint are based on Go plugin.
The Go plugin has restrictions.

Runtime crashes are likely to occur unless all parts of the program (the application and all its plugins) are compiled using exactly the same version of the toolchain, the same build tags, and the same values of certain flags and environment variables.
https://pkg.go.dev/plugin#hdr-Warnings

All versions here need to be the same as in golangci-lint/mod.go if present
https://github.com/golangci/example-plugin-linter/blob/6fa025a9c82ac69e74411ce1b73aa26d3f43186b/go.mod#L3

Plugin dependencies defined in the go.mod file MUST have a matching version (or hash) as the same dependency in the golangc…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@hobbitx
Comment options

@bombsimon
Comment options

@ldez
Comment options

Answer selected by hobbitx
@hobbitx
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants