golangci/golangci-lint · error

plugin(%s): %w

Error message

plugin(%s): %w

What it means

Wrapping error in PluginModuleBuilder.Build: register.GetPlugin(name) failed for a module-type (GoModule) plugin — the plugin was never registered under that name, typically because the plugin package's init() did not call the registration hook or the plugin is not linked into the binary. The plugin name and root cause are embedded.

Source

Thrown at pkg/lint/lintersdb/builder_plugin_module.go:44

// Build loads custom linters that are specified in the golangci-lint config file.
func (b *PluginModuleBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
	if cfg == nil || b.log == nil {
		return nil, nil
	}

	var linters []*linter.Config

	for name, settings := range cfg.Linters.Settings.Custom {
		if settings.Type != modulePluginType {
			continue
		}

		b.log.Infof("Loaded %s: %s", settings.Path, name)

		newPlugin, err := register.GetPlugin(name)
		if err != nil {
			return nil, fmt.Errorf("plugin(%s): %w", name, err)
		}

		p, err := newPlugin(settings.Settings)
		if err != nil {
			return nil, fmt.Errorf("plugin(%s): newPlugin %w", name, err)
		}

		analyzers, err := p.BuildAnalyzers()
		if err != nil {
			return nil, fmt.Errorf("plugin(%s): BuildAnalyzers %w", name, err)
		}

		customLinter := goanalysis.NewLinter(name, settings.Description, analyzers, nil)

		switch strings.ToLower(p.GetLoadMode()) {
		case register.LoadModeSyntax:
			customLinter = customLinter.WithLoadMode(goanalysis.LoadModeSyntax)
		case register.LoadModeTypesInfo:

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Ensure the plugin is built into golangci-lint via the module plugin mechanism (imports in plugins.go)
  2. Verify the plugin's init() registers itself with the expected name
  3. Check the plugin name in the custom settings matches the registered name
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/lint/lintersdb/builder_plugin_module.go:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of golangci/golangci-lint@ed7a235d2d (2026-09-02). Data as JSON: /api/errors/32c292423655b5f6. Report an issue: GitHub.