MCPcopy Create free account
hub / github.com/cortexlabs/cortex / IntPtrFromStrMap

Function IntPtrFromStrMap

pkg/lib/configreader/int_ptr.go:81–95  ·  view source on GitHub ↗
(key string, sMap map[string]string, v *IntPtrValidation)

Source from the content-addressed store, hash-verified

79}
80
81func IntPtrFromStrMap(key string, sMap map[string]string, v *IntPtrValidation) (*int, error) {
82 valStr, ok := sMap[key]
83 if !ok || valStr == "" {
84 val, err := ValidateIntPtrMissing(v)
85 if err != nil {
86 return nil, errors.Wrap(err, key)
87 }
88 return val, nil
89 }
90 val, err := IntPtrFromStr(valStr, v)
91 if err != nil {
92 return nil, errors.Wrap(err, key)
93 }
94 return val, nil
95}
96
97func IntPtrFromStr(valStr string, v *IntPtrValidation) (*int, error) {
98 if valStr == "" {

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.92
ValidateIntPtrMissingFunction · 0.85
IntPtrFromStrFunction · 0.85

Tested by

no test coverage detected