From 52a239a6a199bbf1d431825e9096f35b6363d7f3 Mon Sep 17 00:00:00 2001 From: Oleg Butuzov Date: Wed, 7 Feb 2024 09:07:39 +0200 Subject: [PATCH] #65 - update go version (#80) * #65 - update go version * update surroundings (gocover, tests & release pipeline) --- .github/workflows/main.yaml | 8 ++++---- .github/workflows/release.yaml | 2 +- Dockerfile | 4 ++-- Makefile | 5 +---- analyzer/std.go | 3 +++ scripts/generate-std.sh | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c02ea0a..322a985 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,6 +20,7 @@ jobs: - "1.19" - "1.20" - "1.21" + - "1.22" steps: @@ -42,12 +43,11 @@ jobs: - run: make tests - name: Install goveralls - env: { GO111MODULE: "off" } - if: matrix.go == '1.21' - run: go get github.com/mattn/goveralls + if: matrix.go == '1.22' + run: go install github.com/mattn/goveralls@latest - 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 fef7074..53f621c 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/Makefile b/Makefile index c396621..dfdcd43 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,6 @@ export PATH := $(PWD)/bin:$(PATH) # ./bin to $PATH export SHELL := bash # Default Shell -GOPKGS := $(shell go list ./... | grep -vE "(cmd|testdata)" | tr -s '\n' ',' | sed 's/.\{1\}$$//' ) - - build: @ go build -trimpath -o bin/ireturn ./cmd/ireturn/ @@ -14,7 +11,7 @@ tests: -parallel=2 \ -timeout=1m \ -covermode=atomic \ - -coverpkg=$(GOPKGS) -coverprofile=coverage.cov ./... + -coverprofile=coverage.cov ./... lints: golangci-lint run --no-config ./... -D deadcode 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