1a99ba5 seems to have changed how json null values are decoded into json.RawMessages. After that commit a null value is decoded into an empty byte array whereas before they were decoded into []byte("null"), as can be seen here:
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
Change of behaviour when decoding json null values into RawMessage
encoding/json: Change of behaviour when decoding json null values into RawMessage
Jul 30, 2015
The behavior change with json.RawMessage was not intended.
But the documentation says: "The JSON null value unmarshals into an interface, map, pointer, or slice by setting that Go value to nil." A json.RawMessage is a []byte, so setting it to nil (instead of [110 117 108 108]) seems to be in line with the documentation.
I'm not sure the original authors of this package consider a json.RawMessage should always have the same behavior than a []byte though.
1a99ba5 seems to have changed how json null values are decoded into json.RawMessages. After that commit a null value is decoded into an empty byte array whereas before they were decoded into []byte("null"), as can be seen here:
https://play.golang.org/p/m4ubMyAcqL
The text was updated successfully, but these errors were encountered: