try unmarshalling json quoted with int, with and without ",string", all combination only works
quoted number - with ,string = works
unquoted number - with , string = doesnt work
quoted number - without ,string = doesnt work
unquoted number - without ,string = works
this is quite annoying if there's bunch of fields in the struct (eg. 24+) and the error super unclear json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64, which field?
What did you see happen?
just json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64
What did you expect to see?
either clearer error message showing which field like: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64 field MoneyIDR
or more permissive unmarshalling option that accept both quoted or unquoted number that targets to number field (int64/uint64) so dont have to use js.Number
Go version
all version affected
Output of
go env
in your module/workspace:What did you do?
try unmarshalling json quoted with int, with and without ",string", all combination only works
this is quite annoying if there's bunch of fields in the struct (eg. 24+) and the error super unclear
json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64
, which field?What did you see happen?
just
json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64
What did you expect to see?
either clearer error message showing which field like:
json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64 field MoneyIDR
or more permissive unmarshalling option that accept both quoted or unquoted number that targets to number field (int64/uint64) so dont have to use js.Number