encoding/json: strange isEmptyValue behavior with arrays #31189
What version of Go are you using?
$ go version go version go1.12.1 linux/amd64
Does this issue reproduce with the latest release?
Yes, it does.
What operating system and processor architecture are you using?
The text was updated successfully, but these errors were encountered:
I believe the behavior you're seeing is correct.
A zero-length array is empty:
would have the desired output you expect, however having a zero-length array is likely not what you'd want. I would use slices instead if that works for your use-case.
Changing this behavior would break people who rely on the current encoding semantics with arrays, so it's likely not going to happen.