{"record":{"id":"de228f0e33db57a5","repo":"inancgumus/learngo","slug":"wrong-input-q-line-d-de228f","errorCode":null,"errorMessage":"wrong input: %q (line #%d)","messagePattern":"wrong input: %q \\(line #(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"25-functions/04-pass-by-value-semantics/parser.go","lineNumber":49,"sourceCode":"\tparsed.domain = fields[0]\n\n\tparsed.visits, err = strconv.Atoi(fields[1])\n\tif parsed.visits < 0 || err != nil {\n\t\terr = fmt.Errorf(\"wrong input: %q (line #%d)\", fields[1], p.lines)\n\t\treturn\n\t}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/inancgumus/learngo/blob/3c475a78e54336c6255e925ff66b8ef4da6a2ae7/25-functions/04-pass-by-value-semantics/parser.go#L31-L67","documentation":"parse() rejects the visits column when strconv.Atoi cannot convert it or the value is negative. The offending token is quoted with %q and p.lines pinpoints the line in the log; the parser (passed by value in this exercise) returns the error to main, which stops the run.","triggerScenarios":"Thrown at 25-functions/04-pass-by-value-semantics/parser.go:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pre-validate that the visits field parses as a non-negative integer.","Skip invalid lines and keep processing the rest of the log.","Repair the input data so visits are non-negative integers."],"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"}