Skip to content

Go plugin vs Module plugin #5807

Answered by ldez
jacobhokanson asked this question in Q&A
May 15, 2025 · 1 comments · 12 replies

You must be logged in to vote

Hello,

goplugin is more complex to use because:

  • You need to compile the linter as a Go plugin (require CGO)
  • You need to use the exact same version of the dependencies as golangci-lint.
  • You need to compile the plugin and golangci-lint with the exact same toolchain.
  • It doesn't work on Windows.

module is easier to use:

  • There is a dedicated command custom and a build configuration.
  • The dependencies are handled like a classic Go module.

goplugin was the first plugin system inside golangci-lint, but the constraints to use it drove us to create the module plugin system.

I recommend using module.

References:

Replies: 1 comment 12 replies

You must be logged in to vote
12 replies
@ldez

ldez May 19, 2025
Maintainer

@jacobhokanson

@ldez

ldez May 19, 2025
Maintainer

@swills

@ldez

ldez Jun 1, 2025
Maintainer

Answer selected by jacobhokanson
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