MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / parseAsUint

Function parseAsUint

graphql/admin/removeNode.go:76–90  ·  view source on GitHub ↗
(val interface{}, bitSize int)

Source from the content-addressed store, hash-verified

74}
75
76func parseAsUint(val interface{}, bitSize int) (uint64, error) {
77 ret := uint64(0)
78 var err error
79
80 switch v := val.(type) {
81 case string:
82 ret, err = strconv.ParseUint(v, 10, bitSize)
83 case json.Number:
84 ret, err = strconv.ParseUint(v.String(), 10, bitSize)
85 default:
86 err = errors.Errorf("got unexpected value type")
87 }
88
89 return ret, err
90}

Callers 2

parseAsUint64Function · 0.85
parseAsUint32Function · 0.85

Calls 2

StringMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…