Permalink
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (11 sloc) 288 Bytes
package schema
import "errors"
// Null validates that the value is null.
type Null []FieldValidator
// Validate ensures that value is null.
func (v Null) Validate(value interface{}) (interface{}, error) {
if value != nil {
return nil, errors.New("not null")
}
return value, nil
}