From e52dec6c83b696424a0a23b8ae327686928104c9 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Thu, 15 Aug 2024 00:00:45 +0200 Subject: [PATCH 1/3] Bump go toolchain to 1.23.0 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 013173af5..a6c2798a4 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.22.6 +1.23.0 diff --git a/go.mod b/go.mod index d193e4a6e..347d9fc48 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module go.etcd.io/bbolt -go 1.22 +go 1.23 -toolchain go1.22.6 +toolchain go1.23.0 require ( github.com/spf13/cobra v1.8.1 From 406670b70eda5f7440367d99732d13980955017c Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Thu, 15 Aug 2024 00:28:10 +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-template.yml | 2 ++ .github/workflows/tests_windows.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/tests-template.yml b/.github/workflows/tests-template.yml index 3d34476d5..39fc4082d 100644 --- a/.github/workflows/tests-template.yml +++ b/.github/workflows/tests-template.yml @@ -53,3 +53,5 @@ jobs: esac - name: golangci-lint uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + with: + version: v1.60.1 diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index d03b6cc0b..ed96d9d16 100644 --- a/.github/workflows/tests_windows.yml +++ b/.github/workflows/tests_windows.yml @@ -41,6 +41,8 @@ jobs: shell: bash - name: golangci-lint uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + with: + version: v1.60.1 coverage: needs: ["test-windows"] From a4adf65d6edcaf2f8a9fc4bab4a305b52465daf3 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 349f187ae..5c1947e99 100644 --- a/db.go +++ b/db.go @@ -545,7 +545,7 @@ func (db *DB) munmap() error { // return errors.New(unmapError) if err := munmap(db); err != nil { db.Logger().Errorf("[GOOS: %s, GOARCH: %s] munmap failed, db.datasz: %d, error: %v", runtime.GOOS, runtime.GOARCH, db.datasz, err) - return fmt.Errorf("unmap error: " + err.Error()) + return fmt.Errorf("unmap error: %v", err.Error()) } return nil @@ -593,7 +593,7 @@ func (db *DB) munlock(fileSize int) error { // return errors.New(munlockError) if err := munlock(db, fileSize); err != nil { db.Logger().Errorf("[GOOS: %s, GOARCH: %s] munlock failed, fileSize: %d, db.datasz: %d, error: %v", runtime.GOOS, runtime.GOARCH, fileSize, db.datasz, err) - return fmt.Errorf("munlock error: " + err.Error()) + return fmt.Errorf("munlock error: %v", err.Error()) } return nil } @@ -603,7 +603,7 @@ func (db *DB) mlock(fileSize int) error { // return errors.New(mlockError) if err := mlock(db, fileSize); err != nil { db.Logger().Errorf("[GOOS: %s, GOARCH: %s] mlock failed, fileSize: %d, db.datasz: %d, error: %v", runtime.GOOS, runtime.GOARCH, fileSize, db.datasz, err) - return fmt.Errorf("mlock error: " + err.Error()) + return fmt.Errorf("mlock error: %v", err.Error()) } return nil }