(sourceParam string, dest any, bitSize int, valueMustExist bool)
| 1009 | } |
| 1010 | |
| 1011 | func (b *ValueBinder) floatValue(sourceParam string, dest any, bitSize int, valueMustExist bool) *ValueBinder { |
| 1012 | if b.failFast && b.errors != nil { |
| 1013 | return b |
| 1014 | } |
| 1015 | |
| 1016 | value := b.ValueFunc(sourceParam) |
| 1017 | if value == "" { |
| 1018 | if valueMustExist { |
| 1019 | b.setError(b.ErrorFunc(sourceParam, []string{}, "required field value is empty", nil)) |
| 1020 | } |
| 1021 | return b |
| 1022 | } |
| 1023 | |
| 1024 | return b.float(sourceParam, value, dest, bitSize) |
| 1025 | } |
| 1026 | |
| 1027 | func (b *ValueBinder) float(sourceParam string, value string, dest any, bitSize int) *ValueBinder { |
| 1028 | n, err := strconv.ParseFloat(value, bitSize) |
no test coverage detected