summaryrefslogtreecommitdiff
path: root/vendor/github.com/go-playground/validator/v10/util.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-11-27 13:15:03 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-27 13:15:03 +0000
commit66b77acb1c8b86f0be3836ccaf31683c0bfa317a (patch)
tree9a255a8ea8ef97229b6d75d17de45bdac1755be9 /vendor/github.com/go-playground/validator/v10/util.go
parent[bugfix] Add Actor to outgoing poll vote Create; other fixes (#2384) (diff)
downloadgotosocial-66b77acb1c8b86f0be3836ccaf31683c0bfa317a.tar.xz
[chore]: Bump github.com/gin-contrib/cors from 1.4.0 to 1.5.0 (#2388)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/go-playground/validator/v10/util.go')
-rw-r--r--vendor/github.com/go-playground/validator/v10/util.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/github.com/go-playground/validator/v10/util.go b/vendor/github.com/go-playground/validator/v10/util.go
index 3925cfe1c..4bd947bdf 100644
--- a/vendor/github.com/go-playground/validator/v10/util.go
+++ b/vendor/github.com/go-playground/validator/v10/util.go
@@ -261,13 +261,19 @@ func asUint(param string) uint64 {
return i
}
-// asFloat returns the parameter as a float64
+// asFloat64 returns the parameter as a float64
// or panics if it can't convert
-func asFloat(param string) float64 {
-
+func asFloat64(param string) float64 {
i, err := strconv.ParseFloat(param, 64)
panicIf(err)
+ return i
+}
+// asFloat64 returns the parameter as a float64
+// or panics if it can't convert
+func asFloat32(param string) float64 {
+ i, err := strconv.ParseFloat(param, 32)
+ panicIf(err)
return i
}