From 496d005f2228e06c5652c48d8ea00b93aa322d24 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Mon, 25 Mar 2024 12:36:56 +0100 Subject: [PATCH 1/2] Bump golang to v1.21 Signed-off-by: Volker Theile (cherry picked from commit 5dc08da5facb8559d06b28afdbf4f2b0e02bc9ae) --- .golangci.yaml | 9 +++++---- go.mod | 2 +- pkg/controller/blockdevice/controller.go | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 0afea8c2..6c5d550f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -7,13 +7,14 @@ linters: - revive - gosec - prealloc -run: - skip-files: +issues: + exclude-files: - /zz_generated_ - _generated - skip-dirs: + exclude-dirs: - generated - deadline: 5m +run: + timeout: 5m tests: true build-tags: - test diff --git a/go.mod b/go.mod index 3062a146..0c2520f5 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,6 @@ require ( github.com/stretchr/testify v1.8.2 github.com/urfave/cli/v2 v2.3.0 golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 k8s.io/api v0.27.1 k8s.io/apimachinery v0.27.1 k8s.io/client-go v0.27.1 @@ -98,6 +97,7 @@ require ( github.com/prometheus/procfs v0.9.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect diff --git a/pkg/controller/blockdevice/controller.go b/pkg/controller/blockdevice/controller.go index 51cc1d6a..ab8e09ab 100644 --- a/pkg/controller/blockdevice/controller.go +++ b/pkg/controller/blockdevice/controller.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "reflect" + "slices" "sync" "time" @@ -14,7 +15,6 @@ import ( ghwutil "github.com/jaypipes/ghw/pkg/util" longhornv1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2" "github.com/sirupsen/logrus" - "golang.org/x/exp/slices" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" From abaa6034d03a66e197a0583411dbfebdc7dec859 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Tue, 26 Mar 2024 10:36:16 +0100 Subject: [PATCH 2/2] Bump golangci-lint + fix lint issues Signed-off-by: Volker Theile (cherry picked from commit 55e87521c9820d6042dd47e72e58be18fd8d371b) --- Dockerfile.dapper | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index ce65c747..40ee8071 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -7,7 +7,7 @@ RUN zypper -n rm container-suseconnect && \ zypper -n install git curl docker gzip tar wget awk ## install golangci -RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2 +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1 ## install controller-gen diff --git a/main.go b/main.go index 16ffd074..1e9147a2 100644 --- a/main.go +++ b/main.go @@ -142,7 +142,7 @@ func main() { }, } - app.Action = func(c *cli.Context) error { + app.Action = func(_ *cli.Context) error { initProfiling(&opt) initLogs(&opt) return run(&opt)