From 0a979bd65058457a15191fc6ff4e69153dabf785 Mon Sep 17 00:00:00 2001 From: Mihai Todor Date: Sat, 9 Dec 2023 21:44:13 +0000 Subject: [PATCH] Fix ineffective break statement in dynamic output I noticed this by running [staticcheck](https://staticcheck.dev). Unfortunately, golangci-lint is still using a deprecated version of this linter. See [here](https://github.com/golangci/golangci-lint/issues/853) and [here](https://github.com/golangci/golangci-lint/issues/357). Signed-off-by: Mihai Todor Signed-off-by: harshit-sp --- internal/impl/io/output_dynamic_fan_out.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/impl/io/output_dynamic_fan_out.go b/internal/impl/io/output_dynamic_fan_out.go index 53dbee9bd9..085a073692 100644 --- a/internal/impl/io/output_dynamic_fan_out.go +++ b/internal/impl/io/output_dynamic_fan_out.go @@ -257,6 +257,7 @@ func (d *dynamicFanOutOutputBroker) loop() { _ = atomic.AddInt64(&ackPending, 1) pendingResponses := int64(len(d.outputs)) + outputsLoop: for _, output := range d.outputs { select { case output.tsChan <- message.NewTransactionFunc(ts.Payload.ShallowCopy(), func(ctx context.Context, err error) error { @@ -273,7 +274,7 @@ func (d *dynamicFanOutOutputBroker) loop() { return nil }): case <-d.shutSig.CloseAtLeisureChan(): - break // This signal will be caught again in the next loop + break outputsLoop // This signal will be caught again in the next loop } } d.outputsMut.RUnlock()