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

Function Float64FromStrMap

pkg/lib/configreader/float64.go:74–88  ·  view source on GitHub ↗
(key string, sMap map[string]string, v *Float64Validation)

Source from the content-addressed store, hash-verified

72}
73
74func Float64FromStrMap(key string, sMap map[string]string, v *Float64Validation) (float64, error) {
75 valStr, ok := sMap[key]
76 if !ok || valStr == "" {
77 val, err := ValidateFloat64Missing(v)
78 if err != nil {
79 return 0, errors.Wrap(err, key)
80 }
81 return val, nil
82 }
83 val, err := Float64FromStr(valStr, v)
84 if err != nil {
85 return 0, errors.Wrap(err, key)
86 }
87 return val, nil
88}
89
90func Float64FromStr(valStr string, v *Float64Validation) (float64, error) {
91 if valStr == "" {

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.92
ValidateFloat64MissingFunction · 0.85
Float64FromStrFunction · 0.85

Tested by

no test coverage detected