Closed josiah-tt closed 3 months ago
Here's a demonstration of json.Marshal() behaviour, which is consistent with z.string().nullable()
: https://go.dev/play/p/yALffxm7AS8
&main.T{Data:[]uint8{0x68, 0x69}}
{"Data":"aGk="}
&main.T{Data:[]uint8{}}
{"Data":""}
&main.T{Data:[]uint8(nil)}
{"Data":null}
Nice catch, thanks!
This is a special case noted in the json.Marshal() documentation (https://pkg.go.dev/encoding/json#Marshal):