From a1cc54b7190183d3bc5e3b815a63dd841b9f7248 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Mon, 24 Mar 2025 17:50:13 +0100 Subject: [PATCH] Update for Go 1.24 (#7226) * Update for Go 1.24 * Update Go build to 1.24.1. * Update minimum Go version to 1.23.0. * Bump golangci-lint version. Signed-off-by: SuperQ * Workaround confused golangci-lint error. Signed-off-by: SuperQ --------- Signed-off-by: SuperQ --- .github/workflows/golangci-lint.yml | 2 +- .go-version | 2 +- go.mod | 2 -- plugin/kubernetes/informer_test.go | 5 +++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3fc48f0f2..222e00cc4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,4 +15,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2 with: - version: v1.62.0 + version: v1.64.8 diff --git a/.go-version b/.go-version index ac1df3fce..f9e8384bb 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.23.3 +1.24.1 diff --git a/go.mod b/go.mod index 137a1ee73..9076a1457 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/coredns/coredns go 1.23.0 -toolchain go1.24.1 - require ( github.com/Azure/azure-sdk-for-go v68.0.0+incompatible github.com/Azure/go-autorest/autorest v0.11.30 diff --git a/plugin/kubernetes/informer_test.go b/plugin/kubernetes/informer_test.go index 8babc6093..fa4d3c877 100644 --- a/plugin/kubernetes/informer_test.go +++ b/plugin/kubernetes/informer_test.go @@ -129,11 +129,12 @@ func TestDefaultProcessorWithPod(t *testing.T) { } func testProcessorWithPod(t *testing.T, processor cache.ProcessFunc, idx cache.Indexer) { + container := api.Container{} obj := &api.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "pod1", Namespace: "test1"}, Spec: api.PodSpec{ Containers: []api.Container{ - api.Container{}, + container, }, }, } @@ -141,7 +142,7 @@ func testProcessorWithPod(t *testing.T, processor cache.ProcessFunc, idx cache.I ObjectMeta: metav1.ObjectMeta{Name: "pod1", Namespace: "test1", DeletionTimestamp: &metav1.Time{Time: time.Now()}}, Spec: api.PodSpec{ Containers: []api.Container{ - api.Container{}, + container, }, }, }