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

Function Int32PtrFromStrMap

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.92
ValidateInt32PtrMissingFunction · 0.85
Int32PtrFromStrFunction · 0.85

Tested by

no test coverage detected