We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.9.10
In double quote case (") of Stream.skipObject function, if s.buf ends with backslash (\), the character right next to backslash doesn't escaped.
"
Stream.skipObject
s.buf
\
test.json
{"data": "--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\""}
\0
main.go
package main import ( "fmt" "os" "github.com/goccy/go-json" ) type test struct{} func (t test) UnmarshalJSON(bytes []byte) error { return nil } func main() { file, err := os.Open("./test.json") if err != nil { panic(fmt.Errorf("file open failed: %w", err)) } defer file.Close() d := json.NewDecoder(file) var t test if err := d.Decode(&t); err != nil { panic(fmt.Errorf("decode failed: %w", err)) } }
output
panic: decode failed: json: string of object unexpected end of JSON input
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Version
v0.9.10
Summary
In double quote case (
"
) ofStream.skipObject
function, ifs.buf
ends with backslash (\
), the character right next to backslash doesn't escaped.Way to reproduce this issue
test.json
\0
main.go
output
The text was updated successfully, but these errors were encountered: