File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -81,17 +81,18 @@ This can be enabled with something like this:
8181``` go
8282import (
8383 jsoniter " github.com/json-iterator/go"
84- " github.com/paulmach/orb"
84+ " github.com/paulmach/orb/geojson "
8585)
8686
87- var c = jsoniter.Config {
87+ // in an init() or main(), etc.
88+ c := jsoniter.Config {
8889 EscapeHTML : true ,
8990 SortMapKeys : false ,
9091 MarshalFloatWith6Digits : true ,
9192}.Froze ()
9293
93- CustomJSONMarshaler = c
94- CustomJSONUnmarshaler = c
94+ geojson. CustomJSONMarshaler = c
95+ geojson. CustomJSONUnmarshaler = c
9596```
9697
9798The above change can have dramatic performance implications, see the benchmarks below
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import "encoding/json"
1212// "github.com/paulmach/orb/geojson"
1313// )
1414//
15+ // // in an init() or main(), etc.
1516// var c = jsoniter.Config{
1617// EscapeHTML: true,
1718// SortMapKeys: false,
@@ -33,17 +34,18 @@ var CustomJSONMarshaler interface {
3334//
3435// import (
3536// jsoniter "github.com/json-iterator/go"
36- // "github.com/paulmach/orb"
37+ // "github.com/paulmach/orb/geojson "
3738// )
3839//
39- // var c = jsoniter.Config{
40+ // // in an init() or main(), etc.
41+ // c := jsoniter.Config{
4042// EscapeHTML: true,
4143// SortMapKeys: false,
4244// MarshalFloatWith6Digits: true,
4345// }.Froze()
4446//
45- // orb .CustomJSONMarshaler = c
46- // orb .CustomJSONUnmarshaler = c
47+ // geojson .CustomJSONMarshaler = c
48+ // geojson .CustomJSONUnmarshaler = c
4749//
4850// Note that any errors encountered during unmarshaling will be different.
4951var CustomJSONUnmarshaler interface {
You can’t perform that action at this time.
0 commit comments