Remove unnecessary context.Done() usage
@@ -85,14 +85,9 @@ func produceRecords(ctx context.Context, client *kgo.Client, topic string, batch
return err
}
- select {
- case err := <-errChan:
- if err != nil {
+ if err := <-errChan; err != nil {
return err
}
- case <-ctx.Done():
- return ctx.Err()
- }
}
return nil
