mirror of
https://github.com/gogf/gf.git
synced 2025-04-05 03:05:05 +08:00
fix issue of nil pointer in package internal/utils
This commit is contained in:
parent
190a53647e
commit
d0f2928cec
@ -83,10 +83,11 @@ func IsMap(value interface{}) bool {
|
||||
|
||||
// IsStruct checks whether `value` is type of struct.
|
||||
func IsStruct(value interface{}) bool {
|
||||
var (
|
||||
reflectType = reflect.TypeOf(value)
|
||||
reflectKind = reflectType.Kind()
|
||||
)
|
||||
var reflectType = reflect.TypeOf(value)
|
||||
if reflectType == nil {
|
||||
return false
|
||||
}
|
||||
var reflectKind = reflectType.Kind()
|
||||
for reflectKind == reflect.Ptr {
|
||||
reflectType = reflectType.Elem()
|
||||
reflectKind = reflectType.Kind()
|
||||
|
Loading…
x
Reference in New Issue
Block a user