diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f9a1258..1bce90b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v5 - uses: golangci/golangci-lint-action@v9 with: - version: v2.9 + version: v2.13 commit: runs-on: ubuntu-24.04 diff --git a/validate/validate.go b/validate/validate.go index 82e7b49b..4b2de5dc 100644 --- a/validate/validate.go +++ b/validate/validate.go @@ -742,13 +742,13 @@ func isStruct(t reflect.Type) bool { } func isStructPtr(t reflect.Type) bool { - return t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct + return t.Kind() == reflect.Pointer && t.Elem().Kind() == reflect.Struct } func checkMandatoryUnit(field reflect.Value, tagField reflect.StructField, parent string) (errs error) { mandatory := !strings.Contains(tagField.Tag.Get("json"), "omitempty") switch field.Kind() { - case reflect.Ptr: + case reflect.Pointer: if mandatory && field.IsNil() { errs = multierror.Append(errs, fmt.Errorf("'%s.%s' should not be empty", parent, tagField.Name)) } diff --git a/validate/validate_test.go b/validate/validate_test.go index ac24845e..991dbbc3 100644 --- a/validate/validate_test.go +++ b/validate/validate_test.go @@ -669,7 +669,7 @@ func TestCheckHooks(t *testing.T) { val: rspec.Spec{ Version: "1.0.0", Hooks: &rspec.Hooks{ - Prestart: []rspec.Hook{ + Prestart: []rspec.Hook{ //nolint:staticcheck // Ignore SA1019: rspec.Hooks.Prestart is deprecated { Path: "/usr/bin/fix-mounts", }, @@ -682,7 +682,7 @@ func TestCheckHooks(t *testing.T) { val: rspec.Spec{ Version: "1.0.0", Hooks: &rspec.Hooks{ - Prestart: []rspec.Hook{ + Prestart: []rspec.Hook{ //nolint:staticcheck // Ignore SA1019: rspec.Hooks.Prestart is deprecated { Path: "usr", },