uint256
uint256 copied to clipboard
Use value receiver for String()
I often embed uint256.Int types directly into a struct to avoid the overhead of memory allocation, GC, the pointer memory storage and associated cache misses when following the pointers. When printing such a struct using %v however, the Ints are displayed as an array of their uint64 values.
Can we change the String() method to a value receiver instead? For values of type *T, the methods of T are within its method set, so this would work for both *uint256.Int and uint256.Int.