{"record":{"id":"5aa5cbc767e2c14e","repo":"inancgumus/learngo","slug":"wrong-input-q-line-d-5aa5cb","errorCode":null,"errorMessage":"wrong input: %q (line #%d)","messagePattern":"wrong input: %q \\(line #(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"26-pointers/05-log-parser-pointers-vs-values/parser.go","lineNumber":58,"sourceCode":"\tr.domain = fields[0]\n\tr.visits, err = strconv.Atoi(fields[1])\n\n\tif r.visits < 0 || err != nil {\n\t\tp.lerr = fmt.Errorf(\"wrong input: %q (line #%d)\", fields[1], p.lines)\n\t}\n\treturn","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/inancgumus/learngo/blob/3c475a78e54336c6255e925ff66b8ef4da6a2ae7/26-pointers/05-log-parser-pointers-vs-values/parser.go#L40-L76","documentation":"Pointer-based parse(): fires when the visits token cannot be converted by strconv.Atoi or is negative. The error is stored in p.lerr, which stops all subsequent parsing and aggregation; the quoted token and line number identify the exact bad input.","triggerScenarios":"Thrown at 26-pointers/05-log-parser-pointers-vs-values/parser.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["After parsing, check p.lerr in main and report the invalid line.","Skip lines whose visits column is not a non-negative integer.","Correct the log data at the reported line."],"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"}