MCPcopy Create free account
hub / github.com/buger/jsonparser / ParseInt

Function ParseInt

parser.go:1975–1984  ·  view source on GitHub ↗

ParseInt parses a Number ValueType into a Go int64 SYS-REQ-015, SYS-REQ-039, SYS-REQ-040, SYS-REQ-058, SYS-REQ-059, SYS-REQ-064

(b []byte)

Source from the content-addressed store, hash-verified

1973// ParseInt parses a Number ValueType into a Go int64
1974// SYS-REQ-015, SYS-REQ-039, SYS-REQ-040, SYS-REQ-058, SYS-REQ-059, SYS-REQ-064
1975func ParseInt(b []byte) (int64, error) {
1976 if v, ok, overflow := parseInt(b); !ok {
1977 if overflow {
1978 return 0, OverflowIntegerError
1979 }
1980 return 0, MalformedValueError
1981 } else {
1982 return v, nil
1983 }
1984}
1985
1986// GetArrayLen returns the number of elements in the addressed JSON array.
1987// It scans the array without invoking a callback.

Calls 1

parseIntFunction · 0.85