add 'float' type checker

This commit is contained in:
Adrien Marquès 2018-10-02 11:55:47 +02:00
parent e43623d108
commit 12ddf1feae
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package main
import (
"git.xdrm.io/go/aicra/driver"
)
func main() {}
func Export() driver.Checker { return new(FloatChecker) }
type FloatChecker int
// Match matches the string 'int'
func (fck FloatChecker) Match(name string) bool {
return name == "float"
}
// Check returns true for any type from the @validationTable
func (fck FloatChecker) Check(value interface{}) bool {
// check if float (default wrapping type)
_, ok := value.(float64)
return ok
}