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

Function Float32Ptr

pkg/lib/configreader/float32_ptr.go:54–63  ·  view source on GitHub ↗
(inter interface{}, v *Float32PtrValidation)

Source from the content-addressed store, hash-verified

52}
53
54func Float32Ptr(inter interface{}, v *Float32PtrValidation) (*float32, error) {
55 if inter == nil {
56 return ValidateFloat32PtrProvided(nil, v)
57 }
58 casted, castOk := cast.InterfaceToFloat32(inter)
59 if !castOk {
60 return nil, ErrorInvalidPrimitiveType(inter, PrimTypeFloat)
61 }
62 return ValidateFloat32PtrProvided(&casted, v)
63}
64
65func Float32PtrFromInterfaceMap(key string, iMap map[string]interface{}, v *Float32PtrValidation) (*float32, error) {
66 inter, ok := ReadInterfaceMapValue(key, iMap)

Callers 1

Calls 3

InterfaceToFloat32Function · 0.92

Tested by

no test coverage detected