MCPcopy
hub / github.com/cortexlabs/cortex / BoolPtrFromStrMap

Function BoolPtrFromStrMap

pkg/lib/configreader/bool_ptr.go:63–77  ·  view source on GitHub ↗
(key string, sMap map[string]string, v *BoolPtrValidation)

Source from the content-addressed store, hash-verified

61}
62
63func BoolPtrFromStrMap(key string, sMap map[string]string, v *BoolPtrValidation) (*bool, error) {
64 valStr, ok := sMap[key]
65 if !ok || valStr == "" {
66 val, err := ValidateBoolPtrMissing(v)
67 if err != nil {
68 return nil, errors.Wrap(err, key)
69 }
70 return val, nil
71 }
72 val, err := BoolPtrFromStr(valStr, v)
73 if err != nil {
74 return nil, errors.Wrap(err, key)
75 }
76 return val, nil
77}
78
79func BoolPtrFromStr(valStr string, v *BoolPtrValidation) (*bool, error) {
80 if valStr == "" {

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.92
ValidateBoolPtrMissingFunction · 0.85
BoolPtrFromStrFunction · 0.85

Tested by

no test coverage detected