go-json
go-json copied to clipboard
Support Decoder options for Unmarshal
It would be nice if this library could support Decoder.UseNumber and Decoder.DisallowUnknownFields on the Unmarshal method as well. Currently, as far as I can tell, using these options requires using Decoder, which has two disadvantages:
- If you have data that is already in a byte array then Decoder is slower according to the benchmarks
- As far as I know Decoder has no reliable method to ensure that there is no extra data after the read json object (so for example
{"value": 323};,fdaslfdaksfis considered valid by the decoder, if you only decode one object).
any plan support DisallowUnknownFields?
Is there any plan to support Decoder.UseNumber on the Unmarshal method.