{"record":{"id":"be5cff50dd2bf9d8","repo":"golangci/golangci-lint","slug":"plugin-s-newplugin-w","errorCode":null,"errorMessage":"plugin(%s): newPlugin %w","messagePattern":"plugin\\((.+?)\\): newPlugin %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/lint/lintersdb/builder_plugin_module.go","lineNumber":49,"sourceCode":"\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:\n\t\t\tcustomLinter = customLinter.WithLoadMode(goanalysis.LoadModeTypesInfo)\n\t\tdefault:\n\t\t\tcustomLinter = customLinter.WithLoadMode(goanalysis.LoadModeTypesInfo)\n\t\t}\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/lint/lintersdb/builder_plugin_module.go#L31-L67","documentation":"Wrapping error in PluginModuleBuilder.Build: the plugin constructor newPlugin(settings.Settings) returned an error after successful lookup — i.e. the plugin itself rejected the settings passed from linters-settings.custom. The failure originates inside the plugin's own initialization code.","triggerScenarios":"Thrown at pkg/lint/lintersdb/builder_plugin_module.go:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error from the plugin's constructor","Validate the settings object passed under the custom linter's 'settings' key","Consult the plugin's documentation for accepted settings"],"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"}