From 93aa8b66dc529e6e1496acc4f07470ce9c60be71 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 2 Oct 2018 11:59:12 +0200 Subject: [PATCH] add 'bool' type checker --- internal/checker/default/bool/main.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/checker/default/bool/main.go diff --git a/internal/checker/default/bool/main.go b/internal/checker/default/bool/main.go new file mode 100644 index 0000000..b5fe2ba --- /dev/null +++ b/internal/checker/default/bool/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "git.xdrm.io/go/aicra/driver" +) + +func main() {} +func Export() driver.Checker { return new(BoolChecker) } + +type BoolChecker int + +// Match matches the string 'bool' +func (bck BoolChecker) Match(name string) bool { + return name == "bool" +} + +// Check returns true for any type from the @validationTable +func (bck BoolChecker) Check(value interface{}) bool { + + // check if bool + _, ok := value.(bool) + return ok + +}