mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:50:55 +00:00
fix #1385
This commit is contained in:
parent
332fa44231
commit
4ba50e5df5
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user