{"record":{"id":"f27796b5e25f34b5","repo":"inancgumus/learngo","slug":"wrong-input-q-line-d-f27796","errorCode":null,"errorMessage":"wrong input: %q (line #%d)","messagePattern":"wrong input: %q \\(line #(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"26-pointers/04-log-parser-pointers/parser.go","lineNumber":58,"sourceCode":"\tvar err error\n\n\tparsed.visits, err = strconv.Atoi(fields[1])\n\tif parsed.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/04-log-parser-pointers/parser.go#L40-L76","documentation":"Pointer-based parse(): fires when the visits field fails strconv.Atoi or is negative; the error is saved into p.lerr (no return value), which halts all further parsing and updating. The quoted token and line number let the user find the bad row in the log file.","triggerScenarios":"Thrown at 26-pointers/04-log-parser-pointers/parser.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check p.lerr in main and stop with a clear message about the invalid line.","Filter out lines with non-numeric or negative visit counts before parsing.","Correct the source log so the visits column is a valid non-negative integer."],"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"}