Skip to content

Commit 0a979bd

Browse files
mihaitodorharshit-sp
authored andcommitted
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](golangci/golangci-lint#853) and [here](golangci/golangci-lint#357). Signed-off-by: Mihai Todor <[email protected]> Signed-off-by: harshit-sp <[email protected]>
1 parent 66133f8 commit 0a979bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/impl/io/output_dynamic_fan_out.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ func (d *dynamicFanOutOutputBroker) loop() {
257257
_ = atomic.AddInt64(&ackPending, 1)
258258
pendingResponses := int64(len(d.outputs))
259259

260+
outputsLoop:
260261
for _, output := range d.outputs {
261262
select {
262263
case output.tsChan <- message.NewTransactionFunc(ts.Payload.ShallowCopy(), func(ctx context.Context, err error) error {
@@ -273,7 +274,7 @@ func (d *dynamicFanOutOutputBroker) loop() {
273274
return nil
274275
}):
275276
case <-d.shutSig.CloseAtLeisureChan():
276-
break // This signal will be caught again in the next loop
277+
break outputsLoop // This signal will be caught again in the next loop
277278
}
278279
}
279280
d.outputsMut.RUnlock()

0 commit comments

Comments
 (0)