UnmarshalText implements encoding.TextUnmarshaler.
(input []byte)
| 57 | |
| 58 | // UnmarshalText implements encoding.TextUnmarshaler. |
| 59 | func (i *HexOrDecimal256) UnmarshalText(input []byte) error { |
| 60 | bigint, ok := ParseBig256(string(input)) |
| 61 | if !ok { |
| 62 | return fmt.Errorf("invalid hex or decimal integer %q", input) |
| 63 | } |
| 64 | *i = HexOrDecimal256(*bigint) |
| 65 | return nil |
| 66 | } |
| 67 | |
| 68 | // MarshalText implements encoding.TextMarshaler. |
| 69 | func (i *HexOrDecimal256) MarshalText() ([]byte, error) { |