mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
make big.Int/uint256.Int nil value be formatted as 'nil', not '<nil>'
This commit is contained in:
parent
a86ccc4212
commit
a6198dab39
1 changed files with 2 additions and 2 deletions
|
|
@ -188,13 +188,13 @@ func builtinReplace(_ []string, attr slog.Attr) slog.Attr {
|
||||||
attr = slog.Any(attr.Key, v.Format(timeFormat))
|
attr = slog.Any(attr.Key, v.Format(timeFormat))
|
||||||
case *big.Int:
|
case *big.Int:
|
||||||
if v == nil {
|
if v == nil {
|
||||||
attr.Value = slog.StringValue("<nil>")
|
attr.Value = slog.StringValue("nil")
|
||||||
} else {
|
} else {
|
||||||
attr.Value = slog.StringValue(v.String())
|
attr.Value = slog.StringValue(v.String())
|
||||||
}
|
}
|
||||||
case *uint256.Int:
|
case *uint256.Int:
|
||||||
if v == nil {
|
if v == nil {
|
||||||
attr.Value = slog.StringValue("<nil>")
|
attr.Value = slog.StringValue("nil")
|
||||||
} else {
|
} else {
|
||||||
attr.Value = slog.StringValue(v.Dec())
|
attr.Value = slog.StringValue(v.Dec())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue