What is Nostr?
Nicolas Martyanoff /
npub1dkg…54dt
2024-12-08 14:55:26

Nicolas Martyanoff on Nostr: There's a serious problem with encoding/json in #Go: DisallowUnknownFields is ...

There's a serious problem with encoding/json in #Go: DisallowUnknownFields is useless. When set, the decoder will reject objects with unknown fields, but

1/ the error cannot be identified because it has no specific type (fmt.Errorf);

2/ the error only includes the name of field and not its location/path, making it really confusing in complex structures.

I had high hopes for encoding/json/v2, but the discussion is stucked in limbo.

And I really do not want to write another JSON parser.
Author Public Key
npub1dkg70vzk4vvfsc5cup9gkfu2tcrs5unysl7npfvegf78nkuswr5skh54dt