From 12464eb8bf588297bde82357c84b95552f42f5d4 Mon Sep 17 00:00:00 2001 From: knbr13 Date: Sat, 1 Feb 2025 01:24:51 +0200 Subject: [PATCH] fix: remove redundant nil check for expectations Signed-off-by: knbr13 --- mocks/async_producer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mocks/async_producer.go b/mocks/async_producer.go index 89e0e0db9..cbd5ea64f 100644 --- a/mocks/async_producer.go +++ b/mocks/async_producer.go @@ -74,7 +74,7 @@ func NewAsyncProducer(t ErrorReporter, config *sarama.Config) *AsyncProducer { partitioners[msg.Topic] = partitioner } mp.l.Lock() - if mp.expectations == nil || len(mp.expectations) == 0 { + if len(mp.expectations) == 0 { mp.expectations = nil mp.t.Errorf("No more expectation set on this mock producer to handle the input message.") } else {