From 9374ef94d3954a3fbc66dff19012b4097ca54b2d Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Thu, 15 Aug 2024 00:01:51 +0200 Subject: [PATCH 1/3] Bump go toolchain to 1.22.6 Reference: - https://github.com/etcd-io/etcd/issues/18443 Signed-off-by: Chun-Hung Tseng --- .go-version | 2 +- go.mod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.go-version b/.go-version index 0c5bf37ca..013173af5 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.21.13 +1.22.6 diff --git a/go.mod b/go.mod index 81363a7e5..2ba506a85 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module go.etcd.io/bbolt -go 1.21 +go 1.22 -toolchain go1.21.13 +toolchain go1.22.6 require ( github.com/stretchr/testify v1.8.1 From 2104bc90f3a3516b1e29180d026a6bd59ff80282 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Thu, 15 Aug 2024 00:29:19 +0200 Subject: [PATCH 2/3] Update golangci-lint to v1.60.1 Reference: - https://github.com/golangci/golangci-lint/releases/tag/v1.60.1 Signed-off-by: Chun-Hung Tseng --- .github/workflows/tests.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 35a8ae1a9..5b25dfe8b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -47,7 +47,9 @@ jobs: ;; esac - name: golangci-lint - uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 + uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + with: + version: v1.60.1 test-windows: strategy: @@ -86,7 +88,9 @@ jobs: esac shell: bash - name: golangci-lint - uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 + uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + with: + version: v1.60.1 coverage: needs: ["test-linux", "test-windows"] From 6a0b720300507653dc33175fef934ce264f5ad68 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Fri, 16 Aug 2024 17:12:29 +0200 Subject: [PATCH 3/3] Fix linter reported issues Signed-off-by: Chun-Hung Tseng --- db.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db.go b/db.go index e8a2d1c29..822798e41 100644 --- a/db.go +++ b/db.go @@ -524,7 +524,7 @@ func (db *DB) munmap() error { // gofail: var unmapError string // return errors.New(unmapError) if err := munmap(db); err != nil { - return fmt.Errorf("unmap error: " + err.Error()) + return fmt.Errorf("unmap error: %v", err.Error()) } return nil @@ -571,7 +571,7 @@ func (db *DB) munlock(fileSize int) error { // gofail: var munlockError string // return errors.New(munlockError) if err := munlock(db, fileSize); err != nil { - return fmt.Errorf("munlock error: " + err.Error()) + return fmt.Errorf("munlock error: %v", err.Error()) } return nil } @@ -580,7 +580,7 @@ func (db *DB) mlock(fileSize int) error { // gofail: var mlockError string // return errors.New(mlockError) if err := mlock(db, fileSize); err != nil { - return fmt.Errorf("mlock error: " + err.Error()) + return fmt.Errorf("mlock error: %v", err.Error()) } return nil }