This commit is contained in:
병준 박 2019-11-13 22:23:17 +09:00
parent 9a567d18b7
commit 6eeae49d25

View File

@ -10,3 +10,14 @@ func GetTypeInfo(t reflect.Type) (realType reflect.Type, pkgName string, name st
return t, t.PkgPath(), t.Name() 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()
}