Files
goext/gojson
Mike Schwörer 2cf571579b
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m16s
v0.0.605 do not panic in GoJSONRenderer
2025-09-29 16:39:16 +02:00
..

JSON serializer which serializes nil-Arrays as [] and nil-maps als {}.

Idea from: https://github.com/homelight/json

Forked from 194de8fbfa/src/encoding/json ( tag go1.23.4 ) -> https://github.com/golang/go/tree/go1.23.4/src/encoding/json

Added:

  • MarshalSafeCollections() method
  • Encoder.nilSafeSlices and Encoder.nilSafeMaps fields
  • Add 'tagkey' to use different key than json (set on Decoder struct)
  • Add 'jsonfilter' to filter printed fields (set via MarshalSafeCollections)