From fdb7050201e160aaeacc303f1b4d26111f1d81c9 Mon Sep 17 00:00:00 2001 From: Nicholas Wiersma Date: Wed, 14 Aug 2024 06:30:36 +0200 Subject: [PATCH] chore: support go 1.23, remove go 1.21 (#433) --- .github/workflows/test.yml | 5 ++--- .golangci.yml | 10 ---------- README.md | 2 +- go.mod | 2 +- reader.go | 2 +- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e93dda..8b3b945 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,10 +10,10 @@ jobs: strategy: matrix: - go-version: [ "1.21", "1.22" ] + go-version: [ "1.22", "1.23" ] runs-on: ubuntu-latest env: - GOLANGCI_LINT_VERSION: v1.58.0 + GOLANGCI_LINT_VERSION: v1.60.1 steps: - name: Install Go @@ -37,7 +37,6 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: ${{ env.GOLANGCI_LINT_VERSION }} - skip-pkg-cache: true - name: Run tests run: go test -covermode=count -coverprofile=coverage.out ./... diff --git a/.golangci.yml b/.golangci.yml index e3e2dc5..945c9cd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,18 +10,8 @@ linters: enable-all: true disable: - cyclop # duplicate of gocyclo - - deadcode # deprecated - execinquery # deprecated - - exhaustivestruct # deprecated - - golint # deprecated - gomnd # deprecated - - ifshort # deprecated - - interfacer # deprecated - - maligned # deprecated - - nosnakecase # deprecated - - scopelint # deprecated - - structcheck # deprecated - - varcheck # deprecated - depguard - err113 - exhaustive diff --git a/README.md b/README.md index 90a8666..f4e799a 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ Note that this variable is global, so ideally you'd need to unset it after you'r ## Go Version Support This library supports the last two versions of Go. While the minimum Go version is -not guarantee to increase along side Go, it may jump from time to time to support +not guaranteed to increase along side Go, it may jump from time to time to support additional features. This will be not be considered a breaking change. ## Who uses hamba/avro? diff --git a/go.mod b/go.mod index acfa191..6159850 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hamba/avro/v2 -go 1.20 +go 1.21 require ( github.com/ettle/strcase v0.2.0 diff --git a/reader.go b/reader.go index 0f34cb0..3c11b18 100644 --- a/reader.go +++ b/reader.go @@ -287,7 +287,7 @@ func (r *Reader) readBytes(op string) []byte { if size == 0 { return []byte{} } - if max := r.cfg.getMaxByteSliceSize(); max > 0 && size > max { + if maxSize := r.cfg.getMaxByteSliceSize(); maxSize > 0 && size > maxSize { fnName := "Read" + strings.ToTitle(op) r.ReportError(fnName, "size is greater than `Config.MaxByteSliceSize`") return nil