type WLB struct {
Accessmask []string `json:"accesmask"`
...
But sometimes in our dataset, this field was actually just a string.
The error that the json.Decoder.decode() was json: slice unexpected end of JSON input.
Shouldn't the error be that the value doesn't have the expected type instead?
We had a situation like
But sometimes in our dataset, this field was actually just a
string
. The error that the json.Decoder.decode() wasjson: slice unexpected end of JSON input
.Shouldn't the error be that the value doesn't have the expected type instead?