MCPcopy
hub / github.com/tinylib/msgp / AsInt

Method AsInt

msgp/number.go:32–45  ·  view source on GitHub ↗

AsInt sets the number to an int64.

(i int64)

Source from the content-addressed store, hash-verified

30
31// AsInt sets the number to an int64.
32func (n *Number) AsInt(i int64) {
33 // we always store int(0)
34 // as {0, InvalidType} in
35 // order to preserve
36 // the behavior of the == operator
37 if i == 0 {
38 n.typ = InvalidType
39 n.bits = 0
40 return
41 }
42
43 n.typ = IntType
44 n.bits = uint64(i)
45}
46
47// AsUint sets the number to a uint64.
48func (n *Number) AsUint(u uint64) {

Callers 3

DecodeMsgMethod · 0.95
UnmarshalMsgMethod · 0.95
TestNumberFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestNumberFunction · 0.76