{"id":"2b6695aa28c8f4b8","repo":"jackc/pgx","slug":"found-end-before-closing-double-quote","errorCode":null,"errorMessage":"found end before closing double-quote ('\"')","messagePattern":"found end before closing double-quote \\('\"'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":323,"sourceCode":"}\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:], '\"')\n\tif nextDoubleQuote == -1 {\n\t\treturn \"\", errEOSInQuoted\n\t}\n\tnextDoubleQuote += p.pos\n\tif p.nextBackslash == -1 || p.nextBackslash > nextDoubleQuote {\n\t\t// clone the string from the source string to ensure it can be garbage collected separately\n\t\t// TODO: use strings.Clone on Go 1.20; this could get optimized away\n\t\ts := strings.Clone(p.str[p.pos:nextDoubleQuote])\n\t\tp.pos = nextDoubleQuote + 1\n\t\treturn s, nil\n\t}\n","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L305-L341","documentation":"Error \"found end before closing double-quote ('\"')\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/hstore.go:323 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}