MCPcopy Index your code
hub / github.com/containerd/containerd / parseKV

Function parseKV

internal/oom/utils.go:97–109  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

95}
96
97func parseKV(raw string) (string, uint64, error) {
98 parts := strings.Fields(raw)
99 switch len(parts) {
100 case 2:
101 v, err := parseUint(parts[1], 10, 64)
102 if err != nil {
103 return "", 0, err
104 }
105 return parts[0], v, nil
106 default:
107 return "", 0, cgroupsv2.ErrInvalidFormat
108 }
109}
110
111func parseUint(s string, base, bitSize int) (uint64, error) {
112 v, err := strconv.ParseUint(s, base, bitSize)

Callers 1

readKVStatsFileFunction · 0.85

Calls 1

parseUintFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…