From d1f914102a372bb6fa74f8dd199fdba2fcda37e7 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Wed, 28 Aug 2024 17:12:24 +0200 Subject: [PATCH] Update golangci-lint to v1.60.3 --- Makefile | 2 +- cmd/main.go | 2 +- internal/diag.go | 2 +- internal/version.go | 6 +++--- internal/version_test.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 3716f4d..afb1ef3 100644 --- a/Makefile +++ b/Makefile @@ -55,4 +55,4 @@ $(GOBIN)/go-licence-detector: @ go install go.elastic.co/go-licence-detector@v0.3.0 $(GOBIN)/golangci-lint: - @ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2 + @ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 diff --git a/cmd/main.go b/cmd/main.go index 134c0ac..cf4f49f 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -34,7 +34,7 @@ func main() { Long: "Dump ECK and Kubernetes data for support and troubleshooting purposes.", PreRunE: preRunOperations, Version: internal.Version(), - RunE: func(_ *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return internal.Run(diagParams) }, } diff --git a/internal/diag.go b/internal/diag.go index 65219fd..70ccde4 100644 --- a/internal/diag.go +++ b/internal/diag.go @@ -129,7 +129,7 @@ func Run(params Params) error { operatorVersions = append(operatorVersions, detectECKVersion(clientSet, ns, params.ECKVersion)) } - maxOperatorVersion := max(operatorVersions) + maxOperatorVersion := maxVersion(operatorVersions) logVersion(maxOperatorVersion) allNamespaces := sets.New(params.ResourcesNamespaces...) diff --git a/internal/version.go b/internal/version.go index a0581c1..9feadd8 100644 --- a/internal/version.go +++ b/internal/version.go @@ -99,7 +99,7 @@ func extractVersionFromContainers(containers []corev1.Container) *version.Versio if strings.Contains(container.Image, "eck-operator") { parsed, err := extractVersionFromDockerImage(container.Image) if err != nil { - logger.Printf(err.Error()) + logger.Print(err.Error()) return fallbackMaxVersion } return parsed @@ -142,8 +142,8 @@ func extractVersionFromDockerImage(image string) (*version.Version, error) { return fallbackMaxVersion, nil } -// max returns the maximum of the given versions. -func max(versions []*version.Version) *version.Version { +// maxVersion returns the maximum of the given versions. +func maxVersion(versions []*version.Version) *version.Version { if len(versions) == 0 { return fallbackMaxVersion } diff --git a/internal/version_test.go b/internal/version_test.go index 8b45254..33e2e15 100644 --- a/internal/version_test.go +++ b/internal/version_test.go @@ -50,7 +50,7 @@ func Test_min(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := max(tt.args.versions); !reflect.DeepEqual(got, tt.want) { + if got := maxVersion(tt.args.versions); !reflect.DeepEqual(got, tt.want) { t.Errorf("max() = %v, want %v", got, tt.want) } })