From 83bb4606da59e5e43e437fa2a53648fa8b597162 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 21 Sep 2026 12:05:52 +0100 Subject: [PATCH 1/2] validate: fix what a newer golangci-lint reports A golangci-lint built against Go 1.27 reports four issues on the tree that the currently pinned version never reaches, because it aborts on a typecheck error before any linter runs. Two are govet telling us reflect.Ptr is the old spelling of reflect.Pointer. Two are staticcheck on the deprecated Hooks.Prestart in a test table, annotated the way the non-test use of the same field in checkEventHooks already is. Signed-off-by: Daniel Golle --- validate/validate.go | 4 ++-- validate/validate_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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", }, From 340b6bfd2c9c65f184014fb93ead8df9d8955e61 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 21 Sep 2026 12:07:32 +0100 Subject: [PATCH 2/2] ci: update golangci-lint for compatibility with go1.27 ci started failing once setup-go's "stable" moved to Go 1.27, in the same way it did for go1.26: panic: file requires newer Go version go1.27 (application built with go1.26) golangci-lint v2.9.0 is built with go1.26 and cannot read the export data the newer toolchain writes, so every linter aborts before it runs and the job reports typecheck errors against files no change has touched. v2.13 is the first series built with go1.27. Verified against go1.27.1 with the release binaries the action installs: v2.9.0 fails on this tree with and without the preceding commit, v2.13.2 passes with it and reports only the four issues that commit fixes without it. Signed-off-by: Daniel Golle --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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