From b27faf368fec9a5498635c38983f3ef6f3eb46d8 Mon Sep 17 00:00:00 2001 From: Joel Takvorian Date: Tue, 17 Dec 2024 11:05:29 +0100 Subject: [PATCH] Go1.23, bump golangci-lint --- .github/workflows/pull_request.yml | 4 ++-- .github/workflows/push_image.yml | 4 ++-- .github/workflows/push_image_pr.yml | 2 +- .github/workflows/release.yml | 2 +- .golangci.yml | 7 +++---- Dockerfile | 2 +- Dockerfile.ci | 2 +- Dockerfile.cypress | 2 +- Dockerfile.downstream | 2 +- Makefile | 2 +- pkg/handler/flows.go | 2 +- 11 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 883a122a3..e716c1cf0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.22'] + go: ['1.23'] steps: - name: install make @@ -26,7 +26,7 @@ jobs: - name: check clean vendors run: go mod vendor - name: Report coverage - if: ${{ matrix.go == '1.22' }} + if: ${{ matrix.go == '1.23' }} uses: codecov/codecov-action@v4 with: files: ./cover.out diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index cfa909515..4ccf9dfee 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.22'] + go: ['1.23'] steps: - name: install make run: sudo apt-get install make @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.22'] + go: ['1.23'] steps: - name: install make run: sudo apt-get install make diff --git a/.github/workflows/push_image_pr.yml b/.github/workflows/push_image_pr.yml index 6b1cf3bfb..6b13f723d 100644 --- a/.github/workflows/push_image_pr.yml +++ b/.github/workflows/push_image_pr.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.22'] + go: ['1.23'] steps: - name: install make run: sudo apt-get install make diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2482e37d..95041c2b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.22'] + go: ['1.23'] steps: - name: checkout uses: actions/checkout@v3 diff --git a/.golangci.yml b/.golangci.yml index 52eb3a545..2bc5e4cc6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ linters: - cyclop - errname - exhaustive - - exportloopref + - copyloopvar - gocritic - gofmt - gosimple @@ -16,16 +16,15 @@ linters: - stylecheck - typecheck - unused +run: + go: "1.22" linters-settings: - stylecheck: - go: "1.22" gocritic: enabled-checks: - hugeParam - rangeExprCopy - rangeValCopy - indexAlloc - - deprecatedComment settings: ifElseChain: minThreshold: 3 diff --git a/Dockerfile b/Dockerfile index eebf4eecf..ccb97283c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ WORKDIR /opt/app-root/web RUN npm run format-all RUN npm run build$BUILDSCRIPT -FROM docker.io/library/golang:1.22 as go-builder +FROM docker.io/library/golang:1.23 as go-builder ARG TARGETARCH=amd64 ARG LDFLAGS diff --git a/Dockerfile.ci b/Dockerfile.ci index c667cb9ef..3784fc58f 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1,4 +1,4 @@ -FROM docker.io/library/golang:1.22 +FROM docker.io/library/golang:1.23 RUN apt-get update && apt-get install -y \ nodejs \ diff --git a/Dockerfile.cypress b/Dockerfile.cypress index c9104ba26..56d44644c 100644 --- a/Dockerfile.cypress +++ b/Dockerfile.cypress @@ -20,7 +20,7 @@ WORKDIR /opt/app-root/web RUN npm run format-all RUN npm run build$BUILDSCRIPT -FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 as go-builder +FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 as go-builder ARG LDFLAGS WORKDIR /opt/app-root diff --git a/Dockerfile.downstream b/Dockerfile.downstream index 68c72e24e..92d452a0d 100644 --- a/Dockerfile.downstream +++ b/Dockerfile.downstream @@ -19,7 +19,7 @@ WORKDIR /opt/app-root/web RUN npm run format-all RUN npm run build$BUILDSCRIPT -FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9 as go-builder +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as go-builder ARG BUILDVERSION ARG DATE diff --git a/Makefile b/Makefile index 9b67cc33b..dc597df8f 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ ifneq ($(CLEAN_BUILD),) LDFLAGS ?= -X 'main.buildVersion=${VERSION}-${BUILD_SHA}' -X 'main.buildDate=${BUILD_DATE}' endif -GOLANGCI_LINT_VERSION = v1.53.3 +GOLANGCI_LINT_VERSION = v1.61.0 NPM_INSTALL ?= install CMDLINE_ARGS ?= --loglevel trace --config config/config.yaml diff --git a/pkg/handler/flows.go b/pkg/handler/flows.go index a972af3e2..3d98110e1 100644 --- a/pkg/handler/flows.go +++ b/pkg/handler/flows.go @@ -97,7 +97,7 @@ func (h *Handlers) getFlows(ctx context.Context, lokiClient httpclient.Caller, p {filters.NewMatch(fields.SrcNamespace, `"`+namespace+`"`)}, {filters.NewMatch(fields.DstNamespace, `"`+namespace+`"`)}, }, - func(sq filters.SingleQuery) bool { return false }, + func(_ filters.SingleQuery) bool { return false }, ) }