From 58a468872ec70e60a2223f8341633e5d0a62a1c9 Mon Sep 17 00:00:00 2001 From: Oleg Butuzov Date: Sun, 21 Jan 2024 13:20:27 +0200 Subject: [PATCH] #65 - update go version --- .github/workflows/main.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- Dockerfile | 4 ++-- analyzer/std.go | 3 +++ scripts/generate-std.sh | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 26fcb3f..78b43e7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,9 +16,9 @@ jobs: fail-fast: true matrix: go: - - "1.19" - "1.20" - "1.21" + - "1.22" steps: @@ -42,11 +42,11 @@ jobs: - name: Install goveralls env: { GO111MODULE: "off" } - if: matrix.go == '1.21' + if: matrix.go == '1.22' run: go get github.com/mattn/goveralls - name: Coverage - Sending Report to Coveral - if: matrix.go == '1.21' + if: matrix.go == '1.22' env: COVERALLS_TOKEN: ${{ secrets.github_token }} run: goveralls -coverprofile=coverage.cov -service=github diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 28b5346..ec75378 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ on: - v* env: - GO_VERSION: 1.21 + GO_VERSION: 1.22 jobs: GoReeleaser: diff --git a/Dockerfile b/Dockerfile index c3737ee..7ed2562 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21-alpine as builder +FROM golang:1.22-alpine as builder WORKDIR /build RUN apk add --no-cache upx @@ -9,7 +9,7 @@ RUN go build -trimpath -o bin/ireturn ./cmd/ireturn RUN upx --brute /build/bin/ireturn -FROM golang:1.21-alpine as base +FROM golang:1.22-alpine as base WORKDIR / COPY --from=builder /build/bin/ireturn ireturn VOLUME /app diff --git a/analyzer/std.go b/analyzer/std.go index 4c6c4e4..cac4646 100644 --- a/analyzer/std.go +++ b/analyzer/std.go @@ -197,4 +197,7 @@ var std = map[string]struct{}{ "maps": {}, "slices": {}, "testing/slogtest": {}, + // added in Go v1.22 in compare to v1.21 (docker image) + "go/version": {}, + "math/rand/v2": {}, } diff --git a/scripts/generate-std.sh b/scripts/generate-std.sh index ac99326..cb93298 100755 --- a/scripts/generate-std.sh +++ b/scripts/generate-std.sh @@ -2,7 +2,7 @@ mkdir -p .tmp -tip=21 +tip=22 # create std pkg list for i in $(seq 1 $tip); do