From 5e95582dcdbf7ca02505d823867ce3b82a118673 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Thu, 21 Sep 2023 23:23:03 +0200 Subject: [PATCH] Suppress linter errors --- plugin/plugin_registry_test.go | 1 + pool/pool_test.go | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugin/plugin_registry_test.go b/plugin/plugin_registry_test.go index bf5af611..7a4b2eb2 100644 --- a/plugin/plugin_registry_test.go +++ b/plugin/plugin_registry_test.go @@ -326,6 +326,7 @@ func BenchmarkHookRun(b *testing.B) { ) } for i := 0; i < b.N; i++ { + //nolint:errcheck reg.Run( context.Background(), map[string]interface{}{ diff --git a/pool/pool_test.go b/pool/pool_test.go index a5786fe2..dbb2ada6 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -235,7 +235,7 @@ func BenchmarkPool_PutPop(b *testing.B) { pool := NewPool(context.Background(), config.EmptyPoolCapacity) defer pool.Clear() for i := 0; i < b.N; i++ { - pool.Put("client1.ID", "client1") + pool.Put("client1.ID", "client1") //nolint:errcheck pool.Pop("client1.ID") } } @@ -250,8 +250,8 @@ func BenchmarkPool_Clear(b *testing.B) { func BenchmarkPool_ForEach(b *testing.B) { pool := NewPool(context.Background(), config.EmptyPoolCapacity) defer pool.Clear() - pool.Put("client1.ID", "client1") - pool.Put("client2.ID", "client2") + pool.Put("client1.ID", "client1") //nolint:errcheck + pool.Put("client2.ID", "client2") //nolint:errcheck for i := 0; i < b.N; i++ { pool.ForEach(func(key, value interface{}) bool { return true @@ -262,8 +262,8 @@ func BenchmarkPool_ForEach(b *testing.B) { func BenchmarkPool_Get(b *testing.B) { pool := NewPool(context.Background(), config.EmptyPoolCapacity) defer pool.Clear() - pool.Put("client1.ID", "client1") - pool.Put("client2.ID", "client2") + pool.Put("client1.ID", "client1") //nolint:errcheck + pool.Put("client2.ID", "client2") //nolint:errcheck for i := 0; i < b.N; i++ { pool.Get("client1.ID") pool.Get("client2.ID") @@ -273,11 +273,11 @@ func BenchmarkPool_Get(b *testing.B) { func BenchmarkPool_GetOrPut(b *testing.B) { pool := NewPool(context.Background(), config.EmptyPoolCapacity) defer pool.Clear() - pool.Put("client1.ID", "client1") - pool.Put("client2.ID", "client2") + pool.Put("client1.ID", "client1") //nolint:errcheck + pool.Put("client2.ID", "client2") //nolint:errcheck for i := 0; i < b.N; i++ { - pool.GetOrPut("client1.ID", "client1") - pool.GetOrPut("client2.ID", "client2") + pool.GetOrPut("client1.ID", "client1") //nolint:errcheck + pool.GetOrPut("client2.ID", "client2") //nolint:errcheck } } @@ -285,7 +285,7 @@ func BenchmarkPool_Remove(b *testing.B) { pool := NewPool(context.Background(), config.EmptyPoolCapacity) defer pool.Clear() for i := 0; i < b.N; i++ { - pool.Put("client1.ID", "client1") + pool.Put("client1.ID", "client1") //nolint:errcheck pool.Remove("client1.ID") } }