encoding/json: RawMessage.MarshalJSON should error if it is nil #22686
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Just opened source code :D
What did you see instead?
Open encoding/json/stream.go at 250th line.
In function, MarshalJSON
That means, that error always will be nil. But i think that
if m == nil
should return error that raw message is empty(or nill).In that case, we have to ignore returned error(it's always nill), and check returned array for
if arr == []byte("null")
The text was updated successfully, but these errors were encountered: