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

Function ParseInt

parser.go:2161–2170  ·  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

2159// ParseInt parses a Number ValueType into a Go int64
2160// SYS-REQ-015, SYS-REQ-039, SYS-REQ-040, SYS-REQ-058, SYS-REQ-059, SYS-REQ-064
2161func ParseInt(b []byte) (int64, error) {
2162 if v, ok, overflow := parseInt(b); !ok {
2163 if overflow {
2164 return 0, OverflowIntegerError
2165 }
2166 return 0, MalformedValueError
2167 } else {
2168 return v, nil
2169 }
2170}
2171
2172// GetArrayLen returns the number of elements in the addressed JSON array.
2173// It scans the array without invoking a callback.

Calls 1

parseIntFunction · 0.85