Repository navigation
Migrate from encoding/json to encoding/json/v2 and encoding/json/jsontext - #90
Merged
Merged
Conversation
…n/jsontext Agent-Logs-Url: https://github.com/typisttech/comsarif/sessions/6e5b0c80-793b-4124-a2a2-373c80616594 Co-authored-by: tangrufus <2259834+tangrufus@users.noreply.github.com>
Claude created this pull request from a session on behalf of
tangrufus
August 21, 2026 19:24
View session
Agent-Logs-Url: https://github.com/typisttech/comsarif/sessions/2c2e372a-af0f-43db-8b5f-e0e3e9c52847 Co-authored-by: tangrufus <2259834+tangrufus@users.noreply.github.com>
Agent-Logs-Url: https://github.com/typisttech/comsarif/sessions/0124bda2-1b4b-4a57-8cda-ae321515c579 Co-authored-by: tangrufus <2259834+tangrufus@users.noreply.github.com>
encoding/json to encoding/json/v2 and encoding/json/jsontext
tangrufus
marked this pull request as ready for review
August 21, 2026 19:59
There was a problem hiding this comment.
Pull request overview
Migrates JSON parsing to Go 1.27’s v2 semantic and syntactic APIs.
Changes:
- Uses
encoding/json/v2for audit unmarshaling. - Uses
jsontext.Decoderfor composer.lock streaming. - Updates decoder tests and malformed-input coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
audit.go |
Migrates semantic unmarshaling. |
composer_lock.go |
Migrates token-based parsing and value skipping. |
composer_lock_test.go |
Updates tests for jsontext. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tangrufus
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Go 1.27 ships
encoding/json/v2(semantic JSON) andencoding/json/jsontext(syntactic JSON) as standard library packages. This PR migrates allencoding/jsonv1 usage to these new packages.Changes
audit.go— semantic unmarshalingencoding/json/v2json.Unmarshal→jsonv2.UnmarshalUnmarshalJSON([]byte) errormethods remain — v2 still honours theUnmarshalerinterfacecomposer_lock.go— streaming/syntactic decoderencoding/json/jsontext*json.Decoder/json.NewDecoder→*jsontext.Decoder/jsontext.NewDecoderjson.Delim→jsontext.Kind; delimiter constants replace rune literals ('{'→jsontext.KindBeginObject, etc.)decoder.More()→decoder.PeekKind() != jsontext.KindEnd{Object,Array}decoder.Token()→decoder.ReadToken(); token type assertions replaced withtok.Kind()/tok.String()skipJSONValueremoved — replaced by the built-indecoder.SkipValue()composer_lock_test.gojsontextskipJSONValue(dec)→dec.SkipValue()json.Delimliteral values replaced withjsontext.Kindconstants