{"record":{"id":"32c292423655b5f6","repo":"golangci/golangci-lint","slug":"plugin-s-w","errorCode":null,"errorMessage":"plugin(%s): %w","messagePattern":"plugin\\((.+?)\\): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/lint/lintersdb/builder_plugin_module.go","lineNumber":44,"sourceCode":"\n// Build loads custom linters that are specified in the golangci-lint config file.\nfunc (b *PluginModuleBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {\n\tif cfg == nil || b.log == nil {\n\t\treturn nil, nil\n\t}\n\n\tvar linters []*linter.Config\n\n\tfor name, settings := range cfg.Linters.Settings.Custom {\n\t\tif settings.Type != modulePluginType {\n\t\t\tcontinue\n\t\t}\n\n\t\tb.log.Infof(\"Loaded %s: %s\", settings.Path, name)\n\n\t\tnewPlugin, err := register.GetPlugin(name)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"plugin(%s): %w\", name, err)\n\t\t}\n\n\t\tp, err := newPlugin(settings.Settings)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"plugin(%s): newPlugin %w\", name, err)\n\t\t}\n\n\t\tanalyzers, err := p.BuildAnalyzers()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"plugin(%s): BuildAnalyzers %w\", name, err)\n\t\t}\n\n\t\tcustomLinter := goanalysis.NewLinter(name, settings.Description, analyzers, nil)\n\n\t\tswitch strings.ToLower(p.GetLoadMode()) {\n\t\tcase register.LoadModeSyntax:\n\t\t\tcustomLinter = customLinter.WithLoadMode(goanalysis.LoadModeSyntax)\n\t\tcase register.LoadModeTypesInfo:","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/lint/lintersdb/builder_plugin_module.go#L26-L62","documentation":"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.","triggerScenarios":"Thrown at pkg/lint/lintersdb/builder_plugin_module.go:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the plugin is built into golangci-lint via the module plugin mechanism (imports in plugins.go)","Verify the plugin's init() registers itself with the expected name","Check the plugin name in the custom settings matches the registered name"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}