{"record":{"id":"a086716643d7a25b","repo":"golangci/golangci-lint","slug":"custom-version-w","errorCode":null,"errorMessage":"custom version: %w","messagePattern":"custom version: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/internal/builder.go","lineNumber":183,"sourceCode":"\nfunc (b Builder) goModTidy(ctx context.Context) error {\n\tcmd := exec.CommandContext(ctx, \"go\", \"mod\", \"tidy\")\n\tcmd.Dir = b.repo\n\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tb.log.Warnf(\"%s\", string(output))\n\n\t\treturn fmt.Errorf(\"%s: %w\", strings.Join(cmd.Args, \" \"), err)\n\t}\n\n\treturn nil\n}\n\nfunc (b Builder) goBuild(ctx context.Context, binaryName string) error {\n\tversion, err := b.createVersion(b.cfg.Version)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"custom version: %w\", err)\n\t}\n\n\tb.log.Infof(\"version: %s\", version)\n\n\t//nolint:gosec // the variable is sanitized.\n\tcmd := exec.CommandContext(ctx, \"go\", \"build\",\n\t\t\"-ldflags\",\n\t\tfmt.Sprintf(\"-s -w -X 'main.version=%s' -X 'main.date=%s'\", version, time.Now().UTC().String()),\n\t\t\"-o\", binaryName,\n\t\t\"./cmd/golangci-lint\",\n\t)\n\tcmd.Dir = b.repo\n\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tb.log.Warnf(\"%s\", string(output))\n\n\t\treturn fmt.Errorf(\"%s: %w\", strings.Join(cmd.Args, \" \"), err)","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/commands/internal/builder.go#L165-L201","documentation":"Wrapping error in Builder.goBuild: createVersion failed to derive the version string for the custom binary (e.g. ldflags version assembly from the configured version failed). The build aborts before spawning 'go build'; the wrapped error names the exact parsing/generation failure.","triggerScenarios":"Thrown at pkg/commands/internal/builder.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the configured custom version format","Use a valid golangci-lint version or tag reference","Inspect the wrapped error for the specific parsing failure"],"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"}