mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-24 20:47:16 +00:00
000991b09d
Both Hash and Address have a String method, which returns the value as hex with 0x prefix. They also had a Format method which tried to print the value using printf of []byte. The way Format worked was at odds with String though, leading to a situation where fmt.Sprintf("%v", hash) returned the decimal notation and hash.String() returned a hex string. This commit makes it consistent again. Both types now support the %v, %s, %q format verbs for 0x-prefixed hex output. %x, %X creates unprefixed hex output. %d is also supported and returns the decimal notation "[1 2 3...]". For Address, the case of hex characters in %v, %s, %q output is determined using the EIP-55 checksum. Using %x, %X with Address disables checksumming. Co-authored-by: Felix Lange <fjl@twurst.com> |
||
---|---|---|
.. | ||
bitutil | ||
changeset | ||
compiler | ||
dbutils | ||
debug | ||
etl | ||
fdlimit | ||
hexutil | ||
math | ||
mclock | ||
prque | ||
u256 | ||
big.go | ||
bytes_test.go | ||
bytes.go | ||
chan.go | ||
context.go | ||
debug.go | ||
format.go | ||
hasher.go | ||
path.go | ||
size_test.go | ||
size.go | ||
test_utils.go | ||
tuples_test.go | ||
tuples.go | ||
types_test.go | ||
types.go |