{"record":{"id":"49a8db5cfc6e2254","repo":"inancgumus/learngo","slug":"wrong-input-v-line-d-49a8db","errorCode":null,"errorMessage":"wrong input: %v (line #%d)","messagePattern":"wrong input: (.+?) \\(line #(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"25-functions/04-pass-by-value-semantics/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}","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/inancgumus/learngo/blob/3c475a78e54336c6255e925ff66b8ef4da6a2ae7/25-functions/04-pass-by-value-semantics/parser.go#L23-L59","documentation":"Same validation as the earlier exercise: parse() rejects a log line whose whitespace-separated field count is not exactly two (domain plus visits). The message includes the offending fields slice and the parser's line counter so the bad line can be located in the input file.","triggerScenarios":"Thrown at 25-functions/04-pass-by-value-semantics/parser.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip malformed lines and continue parsing the remaining input.","Fix the log line to contain exactly a domain and a visits value.","Abort and report the offending 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"}