MCPcopy Index your code
hub / github.com/cortexlabs/cortex / IntPtr

Function IntPtr

pkg/lib/configreader/int_ptr.go:54–63  ·  view source on GitHub ↗
(inter interface{}, v *IntPtrValidation)

Source from the content-addressed store, hash-verified

52}
53
54func IntPtr(inter interface{}, v *IntPtrValidation) (*int, error) {
55 if inter == nil {
56 return ValidateIntPtrProvided(nil, v)
57 }
58 casted, castOk := cast.InterfaceToInt(inter)
59 if !castOk {
60 return nil, ErrorInvalidPrimitiveType(inter, PrimTypeInt)
61 }
62 return ValidateIntPtrProvided(&casted, v)
63}
64
65func IntPtrFromInterfaceMap(key string, iMap map[string]interface{}, v *IntPtrValidation) (*int, error) {
66 inter, ok := ReadInterfaceMapValue(key, iMap)

Callers 1

IntPtrFromInterfaceMapFunction · 0.85

Calls 3

InterfaceToIntFunction · 0.92
ValidateIntPtrProvidedFunction · 0.85

Tested by

no test coverage detected