articles-api/type/string/main.go

28 lines
432 B
Go
Raw Normal View History

2018-10-01 17:28:54 +00:00
package main
import (
"git.xdrm.io/go/aicra/driver"
"reflect"
)
func main() {}
func Export() driver.Checker { return new(StringChecker) }
type StringChecker int
func (sck StringChecker) Match(name string) bool {
return name == "string"
}
func (sck StringChecker) Check(value interface{}) bool {
if value == nil {
return false
}
kind := reflect.TypeOf(value).Kind()
return kind == reflect.String
}