golangci/golangci-lint · error

lookup plugin %s: %w

Error message

lookup plugin %s: %w

What it means

Error from PluginGoBuilder.getAnalyzerPlugin: plugin.Open succeeded but plug.Lookup("New") failed, so the fallback lookupAnalyzerPlugin path was also attempted; both failed and the errors are joined. Means the .so exports neither a 'New' constructor nor the deprecated 'AnalyzerPlugin' symbol — the plugin is not a valid golangci-lint Go plugin.

Source

Thrown at pkg/lint/lintersdb/builder_plugin_go.go:104

		basePath, err := fsutils.GetBasePath(context.Background(), cfg.Run.RelativePathMode, cfg.GetConfigDir())
		if err != nil {
			return nil, fmt.Errorf("get base path: %w", err)
		}

		// resolve non-absolute paths relative to config file's directory
		path = filepath.Join(basePath, path)
	}

	//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil
	plug, err := plugin.Open(path)
	//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil
	if err != nil {
		return nil, err
	}

	analyzers, err := b.lookupPlugin(plug, settings)
	if err != nil {
		return nil, fmt.Errorf("lookup plugin %s: %w", path, err)
	}

	return analyzers, nil
}

func (b *PluginGoBuilder) lookupPlugin(plug *plugin.Plugin, settings any) ([]*analysis.Analyzer, error) {
	//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil
	symbol, err := plug.Lookup("New")
	//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil
	if err != nil {
		analyzers, errP := b.lookupAnalyzerPlugin(plug)
		if errP != nil {
			return nil, errors.Join(err, errP)
		}

		return analyzers, nil
	}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Ensure the plugin exports func New(settings any) ([]*analysis.Analyzer, error)
  2. Or export the deprecated AnalyzerPlugin symbol (not recommended)
  3. Rebuild the plugin from a golangci-lint plugin template matching the host version
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/lint/lintersdb/builder_plugin_go.go:104 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/8a3ac8f0f67605d6. Report an issue: GitHub.