From 4f9373a8ac5456d108ccf3ede22ca52ace01461b Mon Sep 17 00:00:00 2001 From: PaulYakow Date: Thu, 2 May 2024 22:33:01 +0500 Subject: [PATCH] fix: update tests/slo/... --- tests/slo/database/sql/main.go | 2 +- tests/slo/gorm/main.go | 2 +- tests/slo/native/query/main.go | 2 +- tests/slo/native/table/main.go | 2 +- tests/slo/native/table/storage.go | 2 +- tests/slo/xorm/main.go | 2 +- tests/slo/xorm/storage.go | 4 +++- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/slo/database/sql/main.go b/tests/slo/database/sql/main.go index 6244e917a..14d527cd4 100644 --- a/tests/slo/database/sql/main.go +++ b/tests/slo/database/sql/main.go @@ -126,6 +126,6 @@ func main() { wg.Wait() default: - panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) + panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113 } } diff --git a/tests/slo/gorm/main.go b/tests/slo/gorm/main.go index ef4a9a079..d48afc488 100644 --- a/tests/slo/gorm/main.go +++ b/tests/slo/gorm/main.go @@ -126,6 +126,6 @@ func main() { wg.Wait() default: - panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) + panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113 } } diff --git a/tests/slo/native/query/main.go b/tests/slo/native/query/main.go index 138187877..59f4af448 100644 --- a/tests/slo/native/query/main.go +++ b/tests/slo/native/query/main.go @@ -134,6 +134,6 @@ func main() { wg.Wait() default: - panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) + panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113 } } diff --git a/tests/slo/native/table/main.go b/tests/slo/native/table/main.go index 9d5df4e72..81f2c301f 100644 --- a/tests/slo/native/table/main.go +++ b/tests/slo/native/table/main.go @@ -126,6 +126,6 @@ func main() { wg.Wait() default: - panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) + panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113 } } diff --git a/tests/slo/native/table/storage.go b/tests/slo/native/table/storage.go index affd5f60b..1d82e6754 100755 --- a/tests/slo/native/table/storage.go +++ b/tests/slo/native/table/storage.go @@ -135,7 +135,7 @@ func (s *Storage) Read(ctx context.Context, entryID generator.RowID) (_ generato } if !res.NextRow() { - return fmt.Errorf("entry not found, id = %v", entryID) + return fmt.Errorf("entry not found, id = %v", entryID) //nolint:goerr113 } err = res.ScanNamed( diff --git a/tests/slo/xorm/main.go b/tests/slo/xorm/main.go index 9d5df4e72..81f2c301f 100644 --- a/tests/slo/xorm/main.go +++ b/tests/slo/xorm/main.go @@ -126,6 +126,6 @@ func main() { wg.Wait() default: - panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) + panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113 } } diff --git a/tests/slo/xorm/storage.go b/tests/slo/xorm/storage.go index 4550374c9..51d964a06 100644 --- a/tests/slo/xorm/storage.go +++ b/tests/slo/xorm/storage.go @@ -32,6 +32,8 @@ var ( writeTx = table.SerializableReadWriteTxControl( table.CommitTx(), ) + + errEntryNotFound = errors.New("get entry: entry not found") ) type mapper struct { @@ -133,7 +135,7 @@ func (s *Storage) Read(ctx context.Context, id generator.RowID) (row generator.R return fmt.Errorf("get entry error: %w", err) } if !has { - return errors.New("get entry: entry not found") + return errEntryNotFound } return nil