This commit is contained in:
2023-10-21 00:26:52 +01:00
parent ff9aca2699
commit 805be22388
5 changed files with 179 additions and 77 deletions

View File

@@ -31,6 +31,21 @@ func CheckNumber(f url.Values, path string, number *int) bool {
return true
}
func CheckFloat64(f url.Values, path string, number *float64) bool {
if CheckEmpty(f, path) {
fmt.Println("here", path)
fmt.Println(f.Get(path))
return false
}
n, err := strconv.ParseFloat(f.Get(path), 64)
if err != nil {
fmt.Println(err)
return false
}
*number = n
return true
}
func CheckId(f url.Values, path string) bool {
return !CheckEmpty(f, path) && IsValidUUID(f.Get(path))
}