(sourceParam string, value string, dest any, bitSize int)
| 1025 | } |
| 1026 | |
| 1027 | func (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 | |
| 1043 | func (b *ValueBinder) floatsValue(sourceParam string, dest any, valueMustExist bool) *ValueBinder { |
| 1044 | if b.failFast && b.errors != nil { |
no test coverage detected