MCPcopy Index your code
hub / github.com/labstack/echo / float

Method float

binder.go:1027–1041  ·  view source on GitHub ↗
(sourceParam string, value string, dest any, bitSize int)

Source from the content-addressed store, hash-verified

1025}
1026
1027func (b *ValueBinder) float(sourceParam string, value string, dest any, bitSize int) *ValueBinder {
1028 n, err := strconv.ParseFloat(value, bitSize)
1029 if err != nil {
1030 b.setError(b.ErrorFunc(sourceParam, []string{value}, fmt.Sprintf("failed to bind field value to float%v", bitSize), err))
1031 return b
1032 }
1033
1034 switch d := dest.(type) {
1035 case *float64:
1036 *d = n
1037 case *float32:
1038 *d = float32(n)
1039 }
1040 return b
1041}
1042
1043func (b *ValueBinder) floatsValue(sourceParam string, dest any, valueMustExist bool) *ValueBinder {
1044 if b.failFast && b.errors != nil {

Callers 2

floatValueMethod · 0.95
floatsMethod · 0.95

Calls 1

setErrorMethod · 0.95

Tested by

no test coverage detected