yjp 6 сар өмнө
parent
commit
2f428bf7a3

+ 1 - 1
reflectutils/type.go

@@ -53,7 +53,7 @@ func IsTypeFloat(t reflect.Type) bool {
 }
 
 func IsTypeStructPointer(t reflect.Type) bool {
-	return t.Kind() == reflect.Pointer && t.Kind() == reflect.Struct
+	return t.Kind() == reflect.Pointer && t.Elem().Kind() == reflect.Struct
 }
 
 func IsTypeStructOrStructPointer(t reflect.Type) bool {

+ 1 - 1
reflectutils/value.go

@@ -57,7 +57,7 @@ func IsValueFloat(v reflect.Value) bool {
 }
 
 func IsValueStructPointer(v reflect.Value) bool {
-	return v.Kind() == reflect.Pointer && v.Kind() == reflect.Struct
+	return v.Kind() == reflect.Pointer && v.Elem().Kind() == reflect.Struct
 }
 
 func IsValueStructOrStructPointer(v reflect.Value) bool {