Commit 4ba50e5d authored by astaxie's avatar astaxie

fix #1385

parent 332fa442
...@@ -74,6 +74,33 @@ func (r Required) IsSatisfied(obj interface{}) bool { ...@@ -74,6 +74,33 @@ func (r Required) IsSatisfied(obj interface{}) bool {
if i, ok := obj.(int); ok { if i, ok := obj.(int); ok {
return i != 0 return i != 0
} }
if i, ok := obj.(uint); ok {
return i != 0
}
if i, ok := obj.(int8); ok {
return i != 0
}
if i, ok := obj.(uint8); ok {
return i != 0
}
if i, ok := obj.(int16); ok {
return i != 0
}
if i, ok := obj.(uint16); ok {
return i != 0
}
if i, ok := obj.(uint32); ok {
return i != 0
}
if i, ok := obj.(int32); ok {
return i != 0
}
if i, ok := obj.(int64); ok {
return i != 0
}
if i, ok := obj.(uint64); ok {
return i != 0
}
if t, ok := obj.(time.Time); ok { if t, ok := obj.(time.Time); ok {
return !t.IsZero() return !t.IsZero()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment