All notable changes to this project are documented in this file.
THIS LIBRARY IS STILL IN ALPHA AND THERE ARE NO GUARANTEES REGARDING API STABILITY YET
v0.7.4 - 2022-03-21
- Fix
reflect.mapiterinit
function prototype for go1.18, changed in https://github.com/golang/go/commit/1b2d794ca3ba60c2dbc958a271662784a7122739. - Update module version to
1.18
and fix build constraint lines.
v0.7.3 - 2021-11-02
- Fix the encoding of zero-value time.Duration type in string format.
v0.7.2 - 2021-08-31
- Minor performances improvements (remove inlined functions in
appendEscapedBytes
).
v0.7.1 - 2020-03-03
- Fix a regression in the marshaling of
nil
map keys that implement theencoding.TextMarshaler
interface, intoduced during refactor in version v0.5.0. - Split
TestTextMarshalerMapKey
andTestNilMarshaler
tests with build constraints to allow previously ignored cases to run with Go1.14.
v0.7.0 - 2020-02-17
- Add the
omitnil
field tag's option, which specifies that a field with a nil pointer should be omitted from the encoding. This option has precedence over theomitempty
option. See this issue for more informations about the original proposal: #22480.
v0.6.0 - 2020-02-14
- Add support for the
sync.Map
type. The marshaling behavior for this type is similar to the one of the Gomap
.
v0.5.0 - 2020-02-02
This includes the following changes, but not limited to:
- Remove the
Encoder
type to simplify the usage of the library and stick more closely to the design ofencoding/json
- Reduce the number of closures used. This improves readability of stacktraces and performance profiles.
- Improve the marshaling performances of many types.
- Add support for marshaling
json.RawMessage
values. - Add new options
DenyList
,NoNumberValidation
,NoCompact
, and rename some others. - Replace the
Marshaler
andMarshalerCtx
interfaces byAppendMarshaler
andAppendMarshalerCtx
to follow the new append model. See this issue for more details: #34701. - Remove the
IntegerBase
option, which didn't worked properly with thestring
JSON tag.
Some of the improvements have been inspired by the github.com/segmentio/encoding project.
v0.4.1 - 2019-10-23
- Fix unsafe misuses reported by go vet and the new
-d=checkptr
cmd/compile flag introduced in the Go1.14 development tree by Matthew Dempsky. The issues were mostly related to invalid arithmetic operations and dereferences. - Fix map key types precedence order during marshaling. Keys of any string type are used directly instead of the
MarshalText
method, if the types also implement theencoding.TextMarshaler
interface.
v0.4.0 - 2019-10-18
- Add the
Marshaler
interface. Types that implements it can write a JSON representation of themselves to aWriter
directly, to avoid having to allocate a buffer as they would usually do when using thejson.Marshaler
interface.
v0.3.1 - 2019-10-09
- Fix HTML characters escaping in struct field names.
- Add examples for Marshal, MarshalTo and Encoder's Encode.
- Refactor string encoding to be compliant with
encoding/json
.
v0.3.0 - 2019-09-23
- Add global functions
Marshal
,MarshalTo
andRegister
. - Update
README.md
: usage, examples and benchmarks.
v0.2.1 - 2019-09-10
- Refactor instructions for types implementing the
json.Marshaler
andencoding.TextMarshaler
interfaces.- Fix encoding of
nil
instances. - Fix behavior for pointer and non-pointer receivers, to comply with
encoding/json
.
- Fix encoding of
- Fix bug that prevents tagged fields to dominate untagged fields.
- Add support for anonymous struct pointer fields.
- Improve tests coverage of
encoder.go
. - Add test cases for unexported non-embedded struct fields.
v0.2.0 - 2019-09-01
- Add support for
json.Number
. - Update
README.md
to add a Go1.12+ requirement notice.
v0.1.0 - 2019-08-30
Initial realease.