worked on #32
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user