Skip to content

Releases: goccy/go-json

0.7.8

01 Sep 03:05
Compare
Choose a tag to compare
  • Fix mapassign_faststr for indirect struct type ( #283 )
  • Fix encoding of not empty interface type ( #284 )
  • Fix encoding of empty struct interface type ( #286 )

0.7.7

25 Aug 04:15
Compare
Choose a tag to compare
  • Fix invalid utf8 on stream decoder ( #279 )
  • Fix buffer length bug on string stream decoder ( #280 )

Thank you @orisano !!

0.7.6

13 Aug 08:32
Compare
Choose a tag to compare
  • Fix nil slice assignment ( #276 )
  • Improve error message ( #277 )

0.7.5

12 Aug 07:16
Compare
Choose a tag to compare
  • Fix encoding of embedded struct with tags ( #265 )
  • Fix encoding of embedded struct that isn't first field ( #272 )
  • Fix decoding of binary type with escaped char ( #273 )

0.7.4

06 Jul 05:24
Compare
Choose a tag to compare
  • Fix encoding of indirect layout structure ( #264 )

0.7.3

29 Jun 02:54
Compare
Choose a tag to compare
  • Fix encoding of pointer type in empty interface ( #262 )

0.7.2

26 Jun 02:16
Compare
Choose a tag to compare

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

17 Jun 16:13
Compare
Choose a tag to compare

Fix decoder

  • Fix error when unmarshal empty array ( #253 )

0.7.0

12 Jun 14:01
Compare
Choose a tag to compare

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 )

Refactor

  • Move some tests to subdirectory ( #243 )
  • Refactor package layout for decoder ( #238 )

0.6.1

02 Jun 10:21
Compare
Choose a tag to compare

Fix encoder

  • Fix value of totalLength for encoding ( #236 )