From 6eeae49d258dd745b305206767b1811b4b6f600a Mon Sep 17 00:00:00 2001 From: Richard Park Date: Wed, 13 Nov 2019 22:23:17 +0900 Subject: [PATCH] ing --- reflect/type.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reflect/type.go b/reflect/type.go index 57aa7f7..e275c3d 100644 --- a/reflect/type.go +++ b/reflect/type.go @@ -10,3 +10,14 @@ func GetTypeInfo(t reflect.Type) (realType reflect.Type, pkgName string, name st return t, t.PkgPath(), t.Name() } + +// IsTypeKind is function +func IsTypeKind(t reflect.Type, kind reflect.Kind, removePtr bool) bool { + if reflect.Ptr == t.Kind() { + if removePtr { + return IsTypeKind(t.Elem(), kind, removePtr) + } + } + + return kind == t.Kind() +}