fix issue of nil pointer in package internal/utils
@@ -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()
