Skip to content

Use value receiver for String() #183

Description

@kaber2

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions