(sourceParam string, values []string, dest any)
| 1056 | } |
| 1057 | |
| 1058 | func (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 |
| 1087 | func (b *ValueBinder) Float64s(sourceParam string, dest *[]float64) *ValueBinder { |
no test coverage detected