Skip to content

Commit

Permalink
Suppress linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Sep 21, 2023
1 parent 62a7849 commit 5e95582
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions plugin/plugin_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{
Expand Down
20 changes: 10 additions & 10 deletions pool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand All @@ -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
Expand All @@ -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")
Expand All @@ -273,19 +273,19 @@ 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
}
}

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")
}
}
Expand Down

0 comments on commit 5e95582

Please sign in to comment.