{"id":"b27243d03bf17b4c","repo":"jackc/pgx","slug":"unexpected-end-of-string","errorCode":null,"errorMessage":"unexpected end of string","messagePattern":"unexpected end of string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":311,"sourceCode":"}\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)\n\t}\n\tp.pos += 2\n\treturn nil\n}\n\nvar errEOSInQuoted = errors.New(`found end before closing double-quote ('\"')`)\n\n// consumeDoubleQuoted consumes a double-quoted string from p. The double quote must have been\n// parsed already. This copies the string from the backing string so it can be garbage collected.\nfunc (p *hstoreParser) consumeDoubleQuoted() (string, error) {\n\t// fast path: assume most keys/values do not contain escapes\n\tnextDoubleQuote := strings.IndexByte(p.str[p.pos:], '\"')","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L293-L329","documentation":"Error \"unexpected end of string\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/hstore.go:311 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}