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

Function ParseInt

parser.go:2067–2076  ·  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

2065// ParseInt parses a Number ValueType into a Go int64
2066// SYS-REQ-015, SYS-REQ-039, SYS-REQ-040, SYS-REQ-058, SYS-REQ-059, SYS-REQ-064
2067func ParseInt(b []byte) (int64, error) {
2068 if v, ok, overflow := parseInt(b); !ok {
2069 if overflow {
2070 return 0, OverflowIntegerError
2071 }
2072 return 0, MalformedValueError
2073 } else {
2074 return v, nil
2075 }
2076}
2077
2078// GetArrayLen returns the number of elements in the addressed JSON array.
2079// It scans the array without invoking a callback.

Calls 1

parseIntFunction · 0.85