Merge branch 'master' of github.com:go-xorm/xorm
This commit is contained in:
commit
f7e6db28c0
|
@ -15,6 +15,10 @@ import (
|
||||||
"github.com/go-xorm/core"
|
"github.com/go-xorm/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type zeroable interface {
|
||||||
|
IsZero() bool
|
||||||
|
}
|
||||||
|
|
||||||
func isZero(k interface{}) bool {
|
func isZero(k interface{}) bool {
|
||||||
switch k.(type) {
|
switch k.(type) {
|
||||||
case int:
|
case int:
|
||||||
|
@ -45,8 +49,8 @@ func isZero(k interface{}) bool {
|
||||||
return k.(bool) == false
|
return k.(bool) == false
|
||||||
case string:
|
case string:
|
||||||
return k.(string) == ""
|
return k.(string) == ""
|
||||||
case time.Time:
|
case zeroable:
|
||||||
return k.(time.Time).IsZero()
|
return k.(zeroable).IsZero()
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue