Releases: goccy/go-json
Releases · goccy/go-json
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
Fix decoder
- Add decoder for func type to fix decoding of nil function value ( #257 )
- Fix stream decoding of []byte type ( #258 )
Performance
- Improve decoding performance of map[string]interface{} type ( use
mapassign_faststr
) ( #256 ) - Improve encoding performance of empty interface type ( remove recursive calling of
vm.Run
) ( #259 )
Benchmark
- Add bytedance/sonic as benchmark target ( #254 )
0.7.1
0.7.0
Support context for MarshalJSON and UnmarshalJSON ( #248 )
- json.MarshalContext(context.Context, interface{}, ...json.EncodeOption) ([]byte, error)
- json.NewEncoder(io.Writer).EncodeContext(context.Context, interface{}, ...json.EncodeOption) error
- json.UnmarshalContext(context.Context, []byte, interface{}, ...json.DecodeOption) error
- json.NewDecoder(io.Reader).DecodeContext(context.Context, interface{}) error
type MarshalerContext interface {
MarshalJSON(context.Context) ([]byte, error)
}
type UnmarshalerContext interface {
UnmarshalJSON(context.Context, []byte) error
}
Add DecodeFieldPriorityFirstWin option ( #242 )
In the default behavior, go-json, like encoding/json, will reflect the result of the last evaluation when a field with the same name exists. I've added new options to allow you to change this behavior. json.DecodeFieldPriorityFirstWin
option reflects the result of the first evaluation if a field with the same name exists. This behavior has a performance advantage as it allows the subsequent strings to be skipped if all fields have been evaluated.
Fix encoder
- Fix indent number contains recursive type ( #249 )
- Fix encoding of using empty interface as map key ( #244 )
Fix decoder
- Fix decoding fields containing escaped characters ( #237 )