You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of json decoder (1.7) requires numbers be integers or strings only if string tag specified. Most web oriented languages (php for example) has no difference between types, so json produced by them can contain integers/floats/booleans as strings.
I suggest to create new tag which permits numbers as strings and ints at same time.
Example:
struct {
Xint`json:"x,maystring"`
}
Can be unmarshalled from {"x":"1234"} and {"x":1234}
The text was updated successfully, but these errors were encountered:
Current implementation of json decoder (1.7) requires numbers be integers or strings only if string tag specified. Most web oriented languages (php for example) has no difference between types, so json produced by them can contain integers/floats/booleans as strings.
I suggest to create new tag which permits numbers as strings and ints at same time.
Example:
Can be unmarshalled from
{"x":"1234"}
and{"x":1234}
The text was updated successfully, but these errors were encountered: