Files
BitSrunLoginGo/models/util/reflect.go
2021-07-27 09:47:45 +08:00

20 lines
286 B
Go

package util
import "reflect"
type reflectR struct{}
var Reflect reflectR
func (*reflectR) IsEmpty(v reflect.Value) bool {
switch v.Kind() {
case reflect.Bool:
return !v.Bool()
case reflect.String:
return v.String() == ""
default:
panic("未设定值")
}
return false
}