tidwall / sjson

Set JSON values very quickly in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: ability to use customized json marshaler

povsister opened this issue · comments

When a type is not recognized, SJSON will fallback to the encoding/json Marshaller.

The standard json library doesn't support type registration, so it's not very ideal to handle complex or customized struct marshaling.
I'd like to have a package level variable in sjson holding a global json marshaler which will be used when a type is not recognized.
Or, we can add a new option in SetOptions specifying the marshaler used for this Set call ?
I prefer the former way, maybe we can add them both ?