2020-03-14 15:13:38 +00:00
|
|
|
package builtin
|
|
|
|
|
2020-03-16 08:20:00 +00:00
|
|
|
import "git.xdrm.io/go/aicra/datatype"
|
2020-03-14 15:13:38 +00:00
|
|
|
|
|
|
|
// AnyDataType is what its name tells
|
|
|
|
type AnyDataType struct{}
|
|
|
|
|
|
|
|
// Build returns the validator
|
2020-03-22 15:50:10 +00:00
|
|
|
func (AnyDataType) Build(typeName string, registry ...datatype.T) datatype.Validator {
|
2020-03-14 15:13:38 +00:00
|
|
|
// nothing if type not handled
|
|
|
|
if typeName != "any" {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return func(value interface{}) (interface{}, bool) {
|
|
|
|
return value, true
|
|
|
|
}
|
|
|
|
}
|