What's Changed
- Encoder: call a pointer-receiver marshaler with the address of a pointer-sized value by @goccy in https://github.com/goccy/go-json/pull/692
- Add github.com/goccy/go-json/jsontext, faster than encoding/json/jsontext by @goccy in https://github.com/goccy/go-json/pull/689
- Share number, string and formatting code between v1 and jsontext, and fix v1 deviations by @goccy in https://github.com/goccy/go-json/pull/693
- Look up a type the recent opcodes miss in the shared table without a call by @goccy in https://github.com/goccy/go-json/pull/674
- Prepare the encoder and jsontext for github.com/goccy/go-json/v2 by @goccy in https://github.com/goccy/go-json/pull/695
- Add the compile mode of the encoding/json/v2 semantics to the encoder by @goccy in https://github.com/goccy/go-json/pull/696
- Add github.com/goccy/go-json/v2 with Marshal, MarshalWrite and MarshalEncode by @goccy in https://github.com/goccy/go-json/pull/698
- Add MarshalOf and MarshalWriteOf to github.com/goccy/go-json/v2, and benchmark the v2 encoder by @goccy in https://github.com/goccy/go-json/pull/699
- Report the coverage by octocov instead of Codecov by @goccy in https://github.com/goccy/go-json/pull/700
- Decoder: follow an embedded pointer to an unexported struct which is set by @minhnhathoang in https://github.com/goccy/go-json/pull/697
- Encoder: read maps by values of their own size, and detect cycles through map values by @goccy in https://github.com/goccy/go-json/pull/704
- Encoder: fix crashes on maps of keys of no size and of values of an interface type with methods by @goccy in https://github.com/goccy/go-json/pull/705
- Encoder: record the values of cycle detection by their types, and a pointer in an interface by itself by @goccy in https://github.com/goccy/go-json/pull/706
- v2: fix panics on keys of an interface type with methods and on misuse of a method's encoder by @goccy in https://github.com/goccy/go-json/pull/707
- jsontext: fail an attached encoder which ends the level it is attached in by @goccy in https://github.com/goccy/go-json/pull/708
- v2: fail the value of a method when a call of MarshalEncode within it fails by @goccy in https://github.com/goccy/go-json/pull/709
- v2: detect cycles through declined values and MarshalEncode called by methods by @goccy in https://github.com/goccy/go-json/pull/710
- v2: write json.Number as a number and fail time.Duration map keys by @goccy in https://github.com/goccy/go-json/pull/711
- v2: rewrite only raw values by the options which rewrite raw values by @goccy in https://github.com/goccy/go-json/pull/712
- Encode json.Number and pointer map keys by their names by @goccy in https://github.com/goccy/go-json/pull/713
- v2: give the string option of a field to its methods and functions by @goccy in https://github.com/goccy/go-json/pull/714
- v2: name keys in interfaces and behind pointers by the functions of their values by @goccy in https://github.com/goccy/go-json/pull/715
- v2: escape field names for JavaScript and keep the escapes of nested calls by @goccy in https://github.com/goccy/go-json/pull/716
- Fail values nested deeper than 10000 levels by @goccy in https://github.com/goccy/go-json/pull/717
- v2: keep nothing of the caller's output in the state of MarshalEncode by @goccy in https://github.com/goccy/go-json/pull/718
- v2: count the depth of methods, nested calls and declined values in the whole output by @goccy in https://github.com/goccy/go-json/pull/719
- v2: fix the names which methods write for map keys by @goccy in https://github.com/goccy/go-json/pull/720
- Count the levels a type nests in its frame for the max depth by @goccy in https://github.com/goccy/go-json/pull/721
- v2: give the functions of marshaling a pointer at the top level as its value by @goccy in https://github.com/goccy/go-json/pull/722
- Fix the option ,string with Colorize and on a pointer to a pointer by @goccy in https://github.com/goccy/go-json/pull/723
- Write a pointer to a nil value with omitempty as null by @goccy in https://github.com/goccy/go-json/pull/724
- Fix small defects found by a review of the whole encoder by @goccy in https://github.com/goccy/go-json/pull/725
- Choose and indent the fields of embedded structs as encoding/json does by @goccy in https://github.com/goccy/go-json/pull/726
- Fail for a value of an unsupported type only when it is encoded by @goccy in https://github.com/goccy/go-json/pull/727
- Add benchmarks of decoding a stream from a chunked reader by @goccy in https://github.com/goccy/go-json/pull/728
- Decode the option ,string on pointers and keys of pointer types as encoding/json of Go 1.27 does by @goccy in https://github.com/goccy/go-json/pull/729
- Add benchmarks of encoding maps under every condition by @goccy in https://github.com/goccy/go-json/pull/732
- Decode the keys of maps as encoding/json does by @goccy in https://github.com/goccy/go-json/pull/733
- Encode the values of a sorted map in the order of the names by @goccy in https://github.com/goccy/go-json/pull/730
- Name a map key of pointers by what they lead to, and fail for a cycle by @goccy in https://github.com/goccy/go-json/pull/735
- Decoder: bound the memory of a stream (supersedes #734) by @goccy in https://github.com/goccy/go-json/pull/736
- Add the sonic Decoder to the stream benchmarks which had none by @goccy in https://github.com/goccy/go-json/pull/737
- Decoder: match encoding/json at the depth limit wherever the reads end by @goccy in https://github.com/goccy/go-json/pull/739
- Decode as encoding/json of Go 1.27 on every version of Go by @goccy in https://github.com/goccy/go-json/pull/740
- Encode a pointer type which is a value of itself through what it points to by @goccy in https://github.com/goccy/go-json/pull/738
- README: describe decoding as Go 1.27's on every Go version, and the stream decoder by elements by @goccy in https://github.com/goccy/go-json/pull/741
- Decode recursive slice, map and array types instead of overflowing the stack by @goccy in https://github.com/goccy/go-json/pull/742
- Decode the fields of embedded structs as encoding/json chooses them by @goccy in https://github.com/goccy/go-json/pull/743
- Compare benchmarks of identical code as identical in the gate by @goccy in https://github.com/goccy/go-json/pull/744
- Add the issues directory: the known work on go-json, one item per file by @goccy in https://github.com/goccy/go-json/pull/745
- v2: add Unmarshal of bools, numbers, strings, bytes, interfaces, slices, arrays and pointers by @goccy in https://github.com/goccy/go-json/pull/746
- Count a benchmark which fails in the base as new in the gate by @goccy in https://github.com/goccy/go-json/pull/747
- v2: add Unmarshal of structs and maps by @goccy in https://github.com/goccy/go-json/pull/748
- v2: add Unmarshal by methods, functions and the time types by @goccy in https://github.com/goccy/go-json/pull/749
- v2: add Unmarshal by UnmarshalJSONFrom and UnmarshalFromFunc by @goccy in https://github.com/goccy/go-json/pull/750
- v2: add UnmarshalOf, and the decoding of v2 to the benchmark report by @goccy in https://github.com/goccy/go-json/pull/751
- v2: add UnmarshalRead and UnmarshalReadOf, which stream with bounded memory by @goccy in https://github.com/goccy/go-json/pull/752
- Bump github.com/klauspost/compress from 1.17.11 to 1.18.7 in /benchmarks by @dependabot[bot] in https://github.com/goccy/go-json/pull/753
- v2: add UnmarshalDecode and UnmarshalDecodeOf by @goccy in https://github.com/goccy/go-json/pull/754
- v2: find struct member names by their words, as v1 does by @goccy in https://github.com/goccy/go-json/pull/755
- v2: decode strings, and the texts of methods and times, in one read by @goccy in https://github.com/goccy/go-json/pull/756
- Name the identifiers by what they do instead of "check" by @goccy in https://github.com/goccy/go-json/pull/757
- v2: match folded names without folding them again, and make boolean options without an allocation by @goccy in https://github.com/goccy/go-json/pull/758
- v2: decode the names of no field and skip their values faster by @goccy in https://github.com/goccy/go-json/pull/759
- v2: skip the values of no field in one scan, and keep the names of a call in one stack by @goccy in https://github.com/goccy/go-json/pull/760
- v2: look the folded names up in a table of the names of the fields by @goccy in https://github.com/goccy/go-json/pull/761
- v2: decode bools and numbers by v1's decoders alone, and match folded names by the field of each folded name by @goccy in https://github.com/goccy/go-json/pull/762
- v2: decode folded names as they are read, skip scalars once, and decode held pointers in place by @goccy in https://github.com/goccy/go-json/pull/763
- v2: keep the name "" in the places of values, and decode the scalars of streams in their buffer by @goccy in https://github.com/goccy/go-json/pull/764
- v2: take v1's paths where v2 decodes as v1, and make the others fast: names twice by hashes, values skipped in one read by @goccy in https://github.com/goccy/go-json/pull/765
- v2: decode structs, streams and UnmarshalDecode by v1's paths where v2 decodes as v1 by @goccy in https://github.com/goccy/go-json/pull/766
- Prepare v0.12.0: describe v2 and jsontext in the README, and pass the tests on Go 1.23 by @goccy in https://github.com/goccy/go-json/pull/767
- Follow encoding/json of Go 1.27.3, and pin CI to it by @goccy in https://github.com/goccy/go-json/pull/768
- Add the options of encoding/json, applied by the engine of v2 by @goccy in https://github.com/goccy/go-json/pull/771
- Call MarshalJSONTo and UnmarshalJSONFrom from the root package by @goccy in https://github.com/goccy/go-json/pull/769
- Decode a float whose digits wrap the mantissa around to 0 (#770) by @goccy in https://github.com/goccy/go-json/pull/772
- issues: drop the parts which master fixed, and state the rest as master has it by @goccy in https://github.com/goccy/go-json/pull/773
- Path: return errors instead of panics, and select by .. at any depth (#774) by @goccy in https://github.com/goccy/go-json/pull/776
- Decoded values keep alive no memory but their own (#775) by @goccy in https://github.com/goccy/go-json/pull/777
- Docs: decoded values keep only their own memory, and DecodeNoCopyString keeps the input (#775) by @goccy in https://github.com/goccy/go-json/pull/778
New Contributors
- @minhnhathoang made their first contribution in https://github.com/goccy/go-json/pull/697
- @dependabot[bot] made their first contribution in https://github.com/goccy/go-json/pull/753
Full Changelog: https://github.com/goccy/go-json/compare/v0.11.2...v0.12.0