{"record":{"id":"5e2c4a4d9f95beb0","repo":"golangci/golangci-lint","slug":"no-colons","errorCode":null,"errorMessage":"no colons","messagePattern":"no colons","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/goanalysis/pkgerrors/parse.go","lineNumber":32,"sourceCode":"\nfunc parseError(srcErr packages.Error) (*result.Issue, error) {\n\tpos, err := parseErrorPosition(srcErr.Pos)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &result.Issue{\n\t\tPos:        *pos,\n\t\tText:       srcErr.Msg,\n\t\tFromLinter: \"typecheck\",\n\t}, nil\n}\n\nfunc parseErrorPosition(pos string) (*token.Position, error) {\n\t// file:line(<optional>:column)\n\tparts := strings.Split(pos, \":\")\n\tif len(parts) == 1 {\n\t\treturn nil, errors.New(\"no colons\")\n\t}\n\n\tfile := parts[0]\n\tline, err := strconv.Atoi(parts[1])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"can't parse line number %q: %w\", parts[1], err)\n\t}\n\n\tvar column int\n\tif len(parts) == 3 { // got column\n\t\tcolumn, err = strconv.Atoi(parts[2])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse column from %q: %w\", parts[2], err)\n\t\t}\n\t}\n\n\treturn &token.Position{\n\t\tFilename: file,","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/goanalysis/pkgerrors/parse.go#L14-L50","documentation":"parseErrorPosition expects a position string in 'file:line(:column)' form as produced by the go/packages driver. It splits on colons and throws 'no colons' when the string contains no colon at all, meaning it cannot even extract a file path/line pair. This happens while parsing package-level error output from analysis runs.","triggerScenarios":"A package error message's position field lacks a colon, e.g. a plain message or a bare path 'somefile.go' instead of 'somefile.go:10'. Triggered via extractErrors/parseError when the driver emits non-standard error text.","commonSituations":"Broken or non-standard build tooling producing malformed go/packages output; custom package drivers or build systems emitting error lines without file:line; cgo or preprocessing errors reported without positional info.","solutions":["Ensure the failing package builds with 'go build ./...' and fix the underlying compile error","Update golangci-lint and toolchain; newer drivers emit properly formatted positions","Check for custom GOFLAGS/build tags or a custom packages driver producing malformed output","Report the malformed error text upstream if it comes from a third-party tool"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !strings.Contains(posStr, \":\") {\n    return fmt.Errorf(\"skipping malformed position %q\", posStr)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"no colons\") {\n    // fall back to treating the message as position-less and log it\n}","preventionTips":["Keep go build clean so go/packages emits well-formed error positions","Avoid custom packages drivers that output non-standard error text","Keep golangci-lint and the Go toolchain in sync"],"tags":["parsing","go-analysis","packages","position"],"backgroundTag":"malformed-error-output","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}