1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 07:40:54 +00:00
This commit is contained in:
astaxie 2015-10-12 20:50:58 +08:00
parent 332fa44231
commit 4ba50e5df5

View File

@ -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()
} }