From 0ead3398a71663edf8e24dae836c957aaf2cc280 Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 21 Jan 2025 17:29:39 +0100 Subject: [PATCH] Bump golang ci lint to work with go 1.24 --- .github/workflows/lint.yml | 4 ++-- pkg/cmd/ruleset/shared/shared.go | 2 +- pkg/cmdutil/json_flags.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0a6c0d9db..f1ae1e522 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,7 +32,7 @@ jobs: go mod verify go mod download - LINT_VERSION=1.59.1 + LINT_VERSION=1.63.4 curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \ tar xz --strip-components 1 --wildcards \*/golangci-lint mkdir -p bin && mv golangci-lint bin/ @@ -53,6 +53,6 @@ jobs: assert-nothing-changed go fmt ./... assert-nothing-changed go mod tidy - bin/golangci-lint run --out-format=github-actions --timeout=3m || STATUS=$? + bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$? exit $STATUS diff --git a/pkg/cmd/ruleset/shared/shared.go b/pkg/cmd/ruleset/shared/shared.go index 3ec1c83ee..536e8a5a9 100644 --- a/pkg/cmd/ruleset/shared/shared.go +++ b/pkg/cmd/ruleset/shared/shared.go @@ -78,7 +78,7 @@ func ParseRulesForDisplay(rules []RulesetRule) string { for _, rule := range rules { display.WriteString(fmt.Sprintf("- %s", rule.Type)) - if rule.Parameters != nil && len(rule.Parameters) > 0 { + if len(rule.Parameters) > 0 { display.WriteString(": ") // sort these keys too for consistency diff --git a/pkg/cmdutil/json_flags.go b/pkg/cmdutil/json_flags.go index 440e0e0b8..596c2f216 100644 --- a/pkg/cmdutil/json_flags.go +++ b/pkg/cmdutil/json_flags.go @@ -254,7 +254,7 @@ func (e *jsonExporter) exportData(v reflect.Value) interface{} { } return m.Interface() case reflect.Struct: - if v.CanAddr() && reflect.PtrTo(v.Type()).Implements(exportableType) { + if v.CanAddr() && reflect.PointerTo(v.Type()).Implements(exportableType) { ve := v.Addr().Interface().(exportable) return ve.ExportData(e.fields) } else if v.Type().Implements(exportableType) {