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

Function Float32FromStrMap

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.92
ValidateFloat32MissingFunction · 0.85
Float32FromStrFunction · 0.85

Tested by

no test coverage detected