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

Method floats

binder.go:1058–1084  ·  view source on GitHub ↗
(sourceParam string, values []string, dest any)

Source from the content-addressed store, hash-verified

1056}
1057
1058func (b *ValueBinder) floats(sourceParam string, values []string, dest any) *ValueBinder {
1059 switch d := dest.(type) {
1060 case *[]float64:
1061 tmp := make([]float64, len(values))
1062 for i, v := range values {
1063 b.float(sourceParam, v, &tmp[i], 64)
1064 if b.failFast && b.errors != nil {
1065 return b
1066 }
1067 }
1068 if b.errors == nil {
1069 *d = tmp
1070 }
1071 case *[]float32:
1072 tmp := make([]float32, len(values))
1073 for i, v := range values {
1074 b.float(sourceParam, v, &tmp[i], 32)
1075 if b.failFast && b.errors != nil {
1076 return b
1077 }
1078 }
1079 if b.errors == nil {
1080 *d = tmp
1081 }
1082 }
1083 return b
1084}
1085
1086// Float64s binds parameter values to slice of float64 variables
1087func (b *ValueBinder) Float64s(sourceParam string, dest *[]float64) *ValueBinder {

Callers 2

bindWithDelimiterMethod · 0.95
floatsValueMethod · 0.95

Calls 1

floatMethod · 0.95

Tested by

no test coverage detected