{"record":{"id":"1efffcce060ddf63","repo":"inancgumus/learngo","slug":"wrong-input-v-line-d-1efffc","errorCode":null,"errorMessage":"wrong input: %v (line #%d)","messagePattern":"wrong input: (.+?) \\(line #(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"26-pointers/exercises/05-log-parser/parser.go","lineNumber":41,"sourceCode":"// parse parses a log line and returns the parsed result with an error\nfunc parse(p parser, line string) (parsed result, err error) {\n\tfields := strings.Fields(line)\n\tif len(fields) != 2 {\n\t\terr = fmt.Errorf(\"wrong input: %v (line #%d)\", fields, p.lines)\n\t\treturn\n\t}\n\n\tparsed.domain = fields[0]","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/inancgumus/learngo/blob/3c475a78e54336c6255e925ff66b8ef4da6a2ae7/26-pointers/exercises/05-log-parser/parser.go#L23-L59","documentation":"Exercise variant of parse(): rejects a log line that does not contain exactly two whitespace-separated fields. The error carries the offending fields slice and p.lines so main can report which line of the log is malformed.","triggerScenarios":"Thrown at 26-pointers/exercises/05-log-parser/parser.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip malformed lines and continue with the rest of the file.","Fix the log line to have exactly domain and visits columns.","Stop and surface the line number to the user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3c475a78e54336c6255e925ff66b8ef4da6a2ae7","analyzedAt":"2026-09-02T10:14:38.492Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}