Skip to content

Go plugin vs Module plugin #5807

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

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 2 replies

Comment options

You must be logged in to vote
2 replies
@jacobhokanson
Comment options

@ldez
Comment options

ldez May 15, 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
2 participants