make big.Int/uint256.Int nil value be formatted as 'nil', not '<nil>'

This commit is contained in:
Jared Wasinger 2023-11-15 18:05:16 +08:00
parent a86ccc4212
commit a6198dab39

View file

@ -188,13 +188,13 @@ func builtinReplace(_ []string, attr slog.Attr) slog.Attr {
attr = slog.Any(attr.Key, v.Format(timeFormat))
case *big.Int:
if v == nil {
attr.Value = slog.StringValue("<nil>")
attr.Value = slog.StringValue("nil")
} else {
attr.Value = slog.StringValue(v.String())
}
case *uint256.Int:
if v == nil {
attr.Value = slog.StringValue("<nil>")
attr.Value = slog.StringValue("nil")
} else {
attr.Value = slog.StringValue(v.Dec())
}