From c9e8e9d2b2318110a7a9f1a0d4c3b2c4b86e4714 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Sat, 6 Aug 2022 19:57:09 +0200 Subject: [PATCH] Upgrade to go1.19 (#44) --- README.md | 2 +- makefiles/base.mk | 2 +- scripts/.golangci.yml | 7 +++++++ scripts/lint.sh | 2 +- templates/github/workflows/bench.yml | 2 +- templates/github/workflows/golangci-lint.yml | 4 ++-- templates/github/workflows/gorelease.yml | 2 +- templates/github/workflows/test-unit.yml | 2 +- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8a30392..17531f7 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project. Add `Makefile` to your module with includes standard targets. ```Makefile -#GOLANGCI_LINT_VERSION := "v1.46.2" # Optional configuration to pinpoint golangci-lint version. +#GOLANGCI_LINT_VERSION := "v1.48.0" # Optional configuration to pinpoint golangci-lint version. # The head of Makefile determines location of dev-go to include standard targets. GO ?= go diff --git a/makefiles/base.mk b/makefiles/base.mk index c181688..4c9e756 100644 --- a/makefiles/base.mk +++ b/makefiles/base.mk @@ -1,4 +1,4 @@ -#GOLANGCI_LINT_VERSION := "v1.46.2" # Optional configuration to pinpoint golangci-lint version. +#GOLANGCI_LINT_VERSION := "v1.48.0" # Optional configuration to pinpoint golangci-lint version. # The head of Makefile determines location of dev-go to include standard targets. GO ?= go diff --git a/scripts/.golangci.yml b/scripts/.golangci.yml index 9fa56cf..7900b03 100644 --- a/scripts/.golangci.yml +++ b/scripts/.golangci.yml @@ -50,5 +50,12 @@ issues: - noctx - funlen - dupl + - structcheck + - unused + - unparam + - nosnakecase path: "_test.go" + - linters: + - errcheck # Error checking omitted for brevity. + path: "example_" diff --git a/scripts/lint.sh b/scripts/lint.sh index f7344c2..bdd1da8 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash [ -z "$GO" ] && GO=go -[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.46.2" +[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.48.0" # detecting GOPATH and removing trailing "/" if any GOPATH="$(go env GOPATH)" diff --git a/templates/github/workflows/bench.yml b/templates/github/workflows/bench.yml index 0e6bddc..d750b9d 100644 --- a/templates/github/workflows/bench.yml +++ b/templates/github/workflows/bench.yml @@ -21,7 +21,7 @@ env: GO111MODULE: "on" CACHE_BENCHMARK: "off" # Enables benchmark result reuse between runs, may skew latency results. RUN_BASE_BENCHMARK: "on" # Runs benchmark for PR base in case benchmark result is missing. - GO_VERSION: 1.18.x + GO_VERSION: 1.19.x jobs: bench: runs-on: ubuntu-latest diff --git a/templates/github/workflows/golangci-lint.yml b/templates/github/workflows/golangci-lint.yml index 48207f9..54723e6 100644 --- a/templates/github/workflows/golangci-lint.yml +++ b/templates/github/workflows/golangci-lint.yml @@ -21,13 +21,13 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - uses: actions/checkout@v2 - name: golangci-lint uses: golangci/golangci-lint-action@v3.1.0 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.46.2 + version: v1.48.0 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/templates/github/workflows/gorelease.yml b/templates/github/workflows/gorelease.yml index f1c678a..6267500 100644 --- a/templates/github/workflows/gorelease.yml +++ b/templates/github/workflows/gorelease.yml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: 1.18.x + GO_VERSION: 1.19.x jobs: gorelease: runs-on: ubuntu-latest diff --git a/templates/github/workflows/test-unit.yml b/templates/github/workflows/test-unit.yml index 28155f3..94441bd 100644 --- a/templates/github/workflows/test-unit.yml +++ b/templates/github/workflows/test-unit.yml @@ -21,7 +21,7 @@ jobs: test: strategy: matrix: - go-version: [ 1.16.x, 1.17.x, 1.18.x ] + go-version: [ 1.16.x, 1.17.x, 1.18.x, 1.19.x ] runs-on: ubuntu-latest steps: - name: Install Go stable