ints

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: CC0-1.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type B

type B = []byte

type Ctx

type Ctx = context.T

type E

type E = error

type N

type N = int

type S

type S = string

type T

type T struct {
	N uint64
}

func New

func New[V int | uint64 | uint32 | uint16 | uint8 | int64 | int32 | int16 | int8](n V) *T

func (*T) MarshalJSON

func (n *T) MarshalJSON(dst B) (b B, err error)

MarshalJSON encodes an uint64 into ASCII decimal format in a []byte.

func (*T) Uint16

func (n *T) Uint16() uint16

func (*T) Uint64

func (n *T) Uint64() uint64

func (*T) UnmarshalJSON

func (n *T) UnmarshalJSON(b B) (r B, err error)

UnmarshalJSON reads a string, which must be a positive integer no larger than math.MaxUint64, skipping any non-numeric content before it.

Note that leading zeros are not considered valid, but basically no such thing as machine generated JSON integers with leading zeroes. Until this is disproven, this is the fastest way to read a positive json integer, and a leading zero is decoded as a zero, and the remainder returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL