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

Function Float64FromInterfaceMap

pkg/lib/configreader/float64.go:58–72  ·  view source on GitHub ↗
(key string, iMap map[string]interface{}, v *Float64Validation)

Source from the content-addressed store, hash-verified

56}
57
58func Float64FromInterfaceMap(key string, iMap map[string]interface{}, v *Float64Validation) (float64, error) {
59 inter, ok := ReadInterfaceMapValue(key, iMap)
60 if !ok {
61 val, err := ValidateFloat64Missing(v)
62 if err != nil {
63 return 0, errors.Wrap(err, key)
64 }
65 return val, nil
66 }
67 val, err := Float64(inter, v)
68 if err != nil {
69 return 0, errors.Wrap(err, key)
70 }
71 return val, nil
72}
73
74func Float64FromStrMap(key string, sMap map[string]string, v *Float64Validation) (float64, error) {
75 valStr, ok := sMap[key]

Callers 1

StructFunction · 0.85

Calls 4

WrapFunction · 0.92
ReadInterfaceMapValueFunction · 0.85
ValidateFloat64MissingFunction · 0.85
Float64Function · 0.70

Tested by

no test coverage detected