From 489b6c9362c89437d3adb901463e4b0759e8c2e2 Mon Sep 17 00:00:00 2001 From: yxxhero <11087727+yxxhero@users.noreply.github.com> Date: Fri, 28 Feb 2025 12:10:16 +0800 Subject: [PATCH] build: update golang version to 1.24 and golangci-lint to v1.64.5 (#1949) * build: update golang version to 1.24 and golangci-lint to v1.64.5 Signed-off-by: yxxhero * build: update golang version to 1.24 in Dockerfiles Signed-off-by: yxxhero * fix more issues Signed-off-by: yxxhero --------- Signed-off-by: yxxhero --- .github/workflows/ci.yaml | 2 +- Dockerfile | 2 +- Dockerfile.debian-stable-slim | 2 +- Dockerfile.ubuntu | 2 +- go.mod | 2 +- pkg/tmpl/context_funcs.go | 6 ++---- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3b1b2669..4f3b4db5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: cache: false - uses: golangci/golangci-lint-action@v6 with: - version: v1.61.0 + version: v1.64.5 tests: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index 938a82d5..5c7c5711 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder RUN apk add --no-cache make git WORKDIR /workspace/helmfile diff --git a/Dockerfile.debian-stable-slim b/Dockerfile.debian-stable-slim index 86b56dde..32c15a49 100644 --- a/Dockerfile.debian-stable-slim +++ b/Dockerfile.debian-stable-slim @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder RUN apk add --no-cache make git WORKDIR /workspace/helmfile diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index f2c01e0c..e8d94578 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder RUN apk add --no-cache make git WORKDIR /workspace/helmfile diff --git a/go.mod b/go.mod index 8a18962d..2327b1e9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/helmfile/helmfile -go 1.23.1 +go 1.24 require ( dario.cat/mergo v1.0.1 diff --git a/pkg/tmpl/context_funcs.go b/pkg/tmpl/context_funcs.go index 12888a91..3cc2119d 100644 --- a/pkg/tmpl/context_funcs.go +++ b/pkg/tmpl/context_funcs.go @@ -391,12 +391,10 @@ func RequiredEnv(name string) (string, error) { func Required(warn string, val any) (any, error) { if val == nil { - // nolint:govet,staticcheck - return nil, fmt.Errorf(warn) + return nil, fmt.Errorf("%s", warn) } else if _, ok := val.(string); ok { if val == "" { - // nolint:govet,staticcheck - return nil, fmt.Errorf(warn) + return nil, fmt.Errorf("%s", warn) } }