What is Nostr?
Nicolas Martyanoff /
npub17vs…jc6l
2024-02-12 09:54:33

Nicolas Martyanoff on Nostr: I just got bit by a common bug in #Go. encoding/json accepts the null JSON value for ...

I just got bit by a common bug in #Go. encoding/json accepts the null JSON value for a slice. As a result, [] is decoded to an empty slice and null to a nil slice. And while both can be used as a zero-length slice, only one of them will be considered equal to nil. Inconsistent.
Author Public Key
npub17vstmkjpd25e72hqjjwu54krhav2nq2unhnm49g268a9drdzhqtqjmjc6l