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.
from https://pkg.go.dev/encoding/json (see quote below), i expected *big.Int to be quoted with the "string" tag option, since by any reasonable interpretation, *big.Int is an "integer". on the other hand, *big.Int does render as arbitrarily large integers in json anyway, but that introduces incompatibility with javascript which uses IEEE-754 floats.
The "string" option signals that a field is stored as JSON inside a JSON-encoded string. It applies only to fields of string, floating point, integer, or boolean types. This extra level of encoding is sometimes used when communicating with JavaScript programs
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
from https://pkg.go.dev/encoding/json (see quote below), i expected *big.Int to be quoted with the "string" tag option, since by any reasonable interpretation, *big.Int is an "integer". on the other hand, *big.Int does render as arbitrarily large integers in json anyway, but that introduces incompatibility with javascript which uses IEEE-754 floats.
see https://go.dev/play/p/dDMU2qYMcqL for how encoding/json package
ignores "string" tag option for *big.Int.
What did you expect to see?
{"Value":"2"}
What did you see instead?
{"Value":2}
The text was updated successfully, but these errors were encountered: