ints

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type B added in v1.0.0

type B = []byte

type Ctx added in v1.0.0

type Ctx = context.T

type E added in v1.0.0

type E = error

type N added in v1.0.0

type N = int

type S added in v1.0.0

type S = string

type T

type T struct {
	N uint64
}

func New

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

func (*T) MarshalJSON added in v1.0.0

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 added in v1.0.0

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