MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / UnmarshalText

Method UnmarshalText

utils/big.go:59–66  ·  view source on GitHub ↗

UnmarshalText implements encoding.TextUnmarshaler.

(input []byte)

Source from the content-addressed store, hash-verified

57
58// UnmarshalText implements encoding.TextUnmarshaler.
59func (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.
69func (i *HexOrDecimal256) MarshalText() ([]byte, error) {

Callers 1

TestHexOrDecimal256Function · 0.95

Calls 3

ParseBig256Function · 0.85
HexOrDecimal256TypeAlias · 0.85
ErrorfMethod · 0.80

Tested by 1

TestHexOrDecimal256Function · 0.76