From a4adf65d6edcaf2f8a9fc4bab4a305b52465daf3 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Fri, 16 Aug 2024 17:12:29 +0200 Subject: [PATCH] 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 }