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

Method floatValue

binder.go:1011–1025  ·  view source on GitHub ↗
(sourceParam string, dest any, bitSize int, valueMustExist bool)

Source from the content-addressed store, hash-verified

1009}
1010
1011func (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
1027func (b *ValueBinder) float(sourceParam string, value string, dest any, bitSize int) *ValueBinder {
1028 n, err := strconv.ParseFloat(value, bitSize)

Callers 4

Float64Method · 0.95
MustFloat64Method · 0.95
Float32Method · 0.95
MustFloat32Method · 0.95

Calls 2

setErrorMethod · 0.95
floatMethod · 0.95

Tested by

no test coverage detected