{"record":{"id":"52e33467f3b76bab","repo":"golangci/golangci-lint","slug":"plugin-does-not-abide-by-new-function-t","errorCode":null,"errorMessage":"plugin does not abide by 'New' function: %T","messagePattern":"plugin does not abide by 'New' function: %T","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/lint/lintersdb/builder_plugin_go.go","lineNumber":126,"sourceCode":"}\n\nfunc (b *PluginGoBuilder) lookupPlugin(plug *plugin.Plugin, settings any) ([]*analysis.Analyzer, error) {\n\t//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil\n\tsymbol, err := plug.Lookup(\"New\")\n\t//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil\n\tif err != nil {\n\t\tanalyzers, errP := b.lookupAnalyzerPlugin(plug)\n\t\tif errP != nil {\n\t\t\treturn nil, errors.Join(err, errP)\n\t\t}\n\n\t\treturn analyzers, nil\n\t}\n\n\t// The type func cannot be used here, must be the explicit signature.\n\tconstructor, ok := symbol.(func(any) ([]*analysis.Analyzer, error))\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"plugin does not abide by 'New' function: %T\", symbol)\n\t}\n\n\treturn constructor(settings)\n}\n\nfunc (b *PluginGoBuilder) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyzer, error) {\n\t//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil\n\tsymbol, err := plug.Lookup(\"AnalyzerPlugin\")\n\t//nolint:staticcheck,nolintlint // Ignore because the implementation on Windows returns nil\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tb.log.Warnf(\"plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: \" +\n\t\t\"https://golangci-lint.run/docs/plugins/go-plugins#create-a-plugin\")\n\n\tanalyzerPlugin, ok := symbol.(AnalyzerPlugin)\n\tif !ok {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/lint/lintersdb/builder_plugin_go.go#L108-L144","documentation":"Type-assertion guard in PluginGoBuilder.lookupPlugin: the plugin exports a symbol named 'New' but its signature is not func(any) ([]*analysis.Analyzer, error), so the assertion to the expected constructor type fails and the actual type (%T) is reported. The plugin does not abide by the required New-function plugin contract.","triggerScenarios":"Thrown at pkg/lint/lintersdb/builder_plugin_go.go:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the plugin's New to exactly match: func(any) ([]*analysis.Analyzer, error)","Rebuild the .so after fixing the signature","Refer to the golangci-lint Go plugins documentation for the required signature"],"exampleFix":null,"handlingStrategy":"validation","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"}