diff --git a/plugins/inputs/kafka_consumer/kafka_consumer_test.go b/plugins/inputs/kafka_consumer/kafka_consumer_test.go
index <HASH>..<HASH> 100644
--- a/plugins/inputs/kafka_consumer/kafka_consumer_test.go
+++ b/plugins/inputs/kafka_consumer/kafka_consumer_test.go
@@ -289,7 +289,7 @@ func TestConsumerGroupHandler_ConsumeClaim(t *testing.T) {
 	}
 
 	go func() {
-		err = cg.ConsumeClaim(session, claim)
+		err := cg.ConsumeClaim(session, claim)
 		require.NoError(t, err)
 	}()
Fix data race in kafka_consumer_test.go (#<I>)