{"id":"6a0d5b2665d4f279","repo":"jackc/pgx","slug":"expected-c-v-found-end","errorCode":null,"errorMessage":"expected '%c' ('%#v'); found end","messagePattern":"expected '%c' \\('%#v'\\); found end","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":299,"sourceCode":"// consume returns the next byte of the string, or end if the string is done.\nfunc (p *hstoreParser) consume() (b byte, end bool) {\n\tif p.pos >= len(p.str) {\n\t\treturn 0, true\n\t}\n\tb = p.str[p.pos]\n\tp.pos++\n\treturn b, false\n}\n\nfunc unexpectedByteErr(actualB, expectedB byte) error {\n\treturn fmt.Errorf(\"expected '%c' ('%#v'); found '%c' ('%#v')\", expectedB, expectedB, actualB, actualB)\n}\n\n// consumeExpectedByte consumes expectedB from the string, or returns an error.\nfunc (p *hstoreParser) consumeExpectedByte(expectedB byte) error {\n\tnextB, end := p.consume()\n\tif end {\n\t\treturn fmt.Errorf(\"expected '%c' ('%#v'); found end\", expectedB, expectedB)\n\t}\n\tif nextB != expectedB {\n\t\treturn unexpectedByteErr(nextB, expectedB)\n\t}\n\treturn nil\n}\n\n// consumeExpected2 consumes two expected bytes or returns an error.\n// This was a bit faster than using a string argument (better inlining? Not sure).\nfunc (p *hstoreParser) consumeExpected2(one, two byte) error {\n\tif p.pos+2 > len(p.str) {\n\t\treturn errors.New(\"unexpected end of string\")\n\t}\n\tif p.str[p.pos] != one {\n\t\treturn unexpectedByteErr(p.str[p.pos], one)\n\t}\n\tif p.str[p.pos+1] != two {\n\t\treturn unexpectedByteErr(p.str[p.pos+1], two)","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L281-L317","documentation":"Error \"expected '%c' ('%#v'); found end\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/hstore.go:299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}