Skip to content

Commit

Permalink
Fix ineffective break statement in dynamic output
Browse files Browse the repository at this point in the history
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 <todormihai@gmail.com>
Signed-off-by: harshit-sp <harshitspatel6600@gmail.com>
  • Loading branch information
mihaitodor authored and harshit-sp committed Feb 4, 2024
1 parent 66133f8 commit 0a979bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/impl/io/output_dynamic_fan_out.go
Expand Up @@ -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 {
Expand All @@ -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()
Expand Down

0 comments on commit 0a979bd

Please sign in to comment.