Skip to content

Commit 873c1f2

Browse files
committed
Update CHANGELOG
1 parent 5c22860 commit 873c1f2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
# v0.7.0 - 2021/06/12
2+
3+
### Support context for MarshalJSON and UnmarshalJSON ( #248 )
4+
5+
* json.MarshalContext(context.Context, interface{}, ...json.EncodeOption) ([]byte, error)
6+
* json.NewEncoder(io.Writer).EncodeContext(context.Context, interface{}, ...json.EncodeOption) error
7+
* json.UnmarshalContext(context.Context, []byte, interface{}, ...json.DecodeOption) error
8+
* json.NewDecoder(io.Reader).DecodeContext(context.Context, interface{}) error
9+
10+
```go
11+
type MarshalerContext interface {
12+
MarshalJSON(context.Context) ([]byte, error)
13+
}
14+
15+
type UnmarshalerContext interface {
16+
UnmarshalJSON(context.Context, []byte) error
17+
}
18+
```
19+
20+
### Add DecodeFieldPriorityFirstWin option ( #242 )
21+
22+
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.
23+
24+
### Fix encoder
25+
26+
* Fix indent number contains recursive type ( #249 )
27+
* Fix encoding of using empty interface as map key ( #244 )
28+
29+
### Fix decoder
30+
31+
* Fix decoding fields containing escaped characters ( #237 )
32+
33+
### Refactor
34+
35+
* Move some tests to subdirectory ( #243 )
36+
* Refactor package layout for decoder ( #238 )
37+
138
# v0.6.1 - 2021/06/02
239

340
### Fix encoder

0 commit comments

Comments
 (0)