{"record":{"id":"1850e8a4b4284218","repo":"golangci/golangci-lint","slug":"add-to-go-mod-w","errorCode":null,"errorMessage":"add to go.mod: %w","messagePattern":"add to go\\.mod: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/internal/builder.go","lineNumber":62,"sourceCode":"\tb.log.Infof(\"Cloning golangci-lint repository\")\n\n\terr := b.clone(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"clone golangci-lint: %w\", err)\n\t}\n\n\tb.log.Infof(\"Adding plugin imports\")\n\n\terr = b.updatePluginsFile()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"update plugin file: %w\", err)\n\t}\n\n\tb.log.Infof(\"Adding replace directives\")\n\n\terr = b.addToGoMod(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"add to go.mod: %w\", err)\n\t}\n\n\tb.log.Infof(\"Running go mod tidy\")\n\n\terr = b.goModTidy(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"go mod tidy: %w\", err)\n\t}\n\n\tb.log.Infof(\"Building golangci-lint binary\")\n\n\tbinaryName := b.getBinaryName()\n\n\terr = b.goBuild(ctx, binaryName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"build golangci-lint binary: %w\", err)\n\t}\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/commands/internal/builder.go#L44-L80","documentation":"Wrapping error in Builder.Build for custom builds: the addToGoMod step (running 'go mod edit -replace' to add replace directives for plugins) failed. Common causes are a missing or malformed go.mod in the cloned repo or an invalid module path/version in the plugin configuration. The underlying command error is wrapped with %w.","triggerScenarios":"Thrown at pkg/commands/internal/builder.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the plugin's module path and version in the custom linter settings","Verify the cloned golangci-lint repository has a valid go.mod","Inspect logged go command output for the root cause","Check network/Go toolchain availability"],"exampleFix":null,"handlingStrategy":"retry","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"}