Open zhiqiangxu opened 6 months ago
Could you share a specific example that reproduce the issue? Thanks.
Could you share a specific example that reproduce the issue? Thanks.
Here is the minimal program to reproduce.
It reports: json: cannot unmarshal hex string without 0x prefix into Go value of type common.Hash
(In my actual case, the map has a lot of fields.)
@cherrymui maybe the WaitingForInfo
label can be removed?
Thanks.
cc @rsc @dsnet @bradfitz @mvdan
The v2 JSON discussion (https://github.com/golang/go/discussions/63397) includes a JSONPointer
field in jsontext.SyntacticError
and json.SemanticError
. Such a field would be used to store a JSON pointer (RFC 6901), that would describe exactly where an error occurred.
Support for populating this is planned, but not currently implemented in the prototype implementation at https://github.com/go-json-experiment/json.
Go version
go version go1.22.0 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
I'm decoding a
map
with many fields, but the error I got is:There's no information about which field is causing the error.
What did you see happen?
The error information when decoding
map
is vague, it doesn't indicate which field is causing the error.What did you expect to see?
I expect to see which field(the specific
key
orvalue
) is causing the error.