{"record":{"id":"30358e69c71ea2c0","repo":"golangci/golangci-lint","slug":"build-golangci-lint-binary-w","errorCode":null,"errorMessage":"build golangci-lint binary: %w","messagePattern":"build golangci-lint binary: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/internal/builder.go","lineNumber":78,"sourceCode":"\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\n\tb.log.Infof(\"Moving golangci-lint binary\")\n\n\terr = b.copyBinary(binaryName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"move golangci-lint binary: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (b Builder) clone(ctx context.Context) error {\n\t//nolint:gosec // the variable is sanitized.\n\tcmd := exec.CommandContext(ctx,\n\t\t\"git\", \"clone\", \"--branch\", sanitizeVersion(b.cfg.Version),\n\t\t\"--single-branch\", \"--depth\", \"1\", \"-c\", \"advice.detachedHead=false\", \"-q\",\n\t\t\"https://github.com/golangci/golangci-lint.git\",","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/commands/internal/builder.go#L60-L96","documentation":"Wrapping error in Builder.Build: the goBuild step ('go build' producing the custom golangci-lint binary) failed. Causes include compile errors in plugin sources, missing dependencies, a bad output target, or an unsupported Go toolchain. The underlying exec error is wrapped with %w.","triggerScenarios":"Thrown at pkg/commands/internal/builder.go:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the build output logged by the builder for compile errors","Verify plugin code compiles against the target golangci-lint version","Check the Go toolchain version and CGO settings","Fix any reported plugin type errors (e.g. wrong New signature)"],"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"}