MCPcopy Create free account
hub / github.com/containerd/containerd / parseUint

Function parseUint

internal/oom/utils.go:111–127  ·  view source on GitHub ↗
(s string, base, bitSize int)

Source from the content-addressed store, hash-verified

109}
110
111func parseUint(s string, base, bitSize int) (uint64, error) {
112 v, err := strconv.ParseUint(s, base, bitSize)
113 if err != nil {
114 intValue, intErr := strconv.ParseInt(s, base, bitSize)
115 // 1. Handle negative values greater than MinInt64 (and)
116 // 2. Handle negative values lesser than MinInt64
117 if intErr == nil && intValue < 0 {
118 return 0, nil
119 } else if intErr != nil &&
120 intErr.(*strconv.NumError).Err == strconv.ErrRange &&
121 intValue < 0 {
122 return 0, nil
123 }
124 return 0, err
125 }
126 return v, nil
127}

Callers 1

parseKVFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…