Change reflect.Ptr to reflect.Pointer

This commit is contained in:
21kyu
2022-06-26 01:23:43 +09:00
parent d2c5779dad
commit df168d5b5c
38 changed files with 70 additions and 70 deletions

View File

@@ -266,7 +266,7 @@ func TestPVSecrets(t *testing.T) {
func collectSecretPaths(t *testing.T, path *field.Path, name string, tp reflect.Type) sets.String {
secretPaths := sets.NewString()
if tp.Kind() == reflect.Ptr {
if tp.Kind() == reflect.Pointer {
secretPaths.Insert(collectSecretPaths(t, path, name, tp.Elem()).List()...)
return secretPaths
}
@@ -276,7 +276,7 @@ func collectSecretPaths(t *testing.T, path *field.Path, name string, tp reflect.
}
switch tp.Kind() {
case reflect.Ptr:
case reflect.Pointer:
secretPaths.Insert(collectSecretPaths(t, path, name, tp.Elem()).List()...)
case reflect.Struct:
// ObjectMeta should not have any field with the word "secret" in it;

View File

@@ -555,7 +555,7 @@ func collectResourcePaths(t *testing.T, resourcename string, path *field.Path, n
resourcename = strings.ToLower(resourcename)
resourcePaths := sets.NewString()
if tp.Kind() == reflect.Ptr {
if tp.Kind() == reflect.Pointer {
resourcePaths.Insert(collectResourcePaths(t, resourcename, path, name, tp.Elem()).List()...)
return resourcePaths
}
@@ -565,7 +565,7 @@ func collectResourcePaths(t *testing.T, resourcename string, path *field.Path, n
}
switch tp.Kind() {
case reflect.Ptr:
case reflect.Pointer:
resourcePaths.Insert(collectResourcePaths(t, resourcename, path, name, tp.Elem()).List()...)
case reflect.Struct:
// ObjectMeta is generic and therefore should never have a field with a specific resource's name;