diff options
author | Josh Bleecher Snyder <josh@tailscale.com> | 2020-12-04 14:26:51 -0800 |
---|---|---|
committer | Josh Bleecher Snyder <josh@tailscale.com> | 2020-12-08 14:24:20 -0800 |
commit | 01d3aaa7f418dd0ca86643ddcc8c82544cb8398b (patch) | |
tree | c1619b27d75c0f4dc007654f155e4d343d6214c7 /device | |
parent | b6303091fc8c11cf86b92e9c4287c0ba74e77e87 (diff) |
device: use labeled for loop instead of goto
Minor code cleanup; no functional changes.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to 'device')
-rw-r--r-- | device/send.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/device/send.go b/device/send.go index d202b62..fa4da0e 100644 --- a/device/send.go +++ b/device/send.go @@ -365,8 +365,8 @@ func (peer *Peer) RoutineNonce() { peer.routines.starting.Done() logDebug.Println(peer, "- Routine: nonce worker - started") +NextPacket: for { - NextPacket: peer.queue.packetInNonceQueueIsAwaitingKey.Set(false) select { @@ -375,7 +375,7 @@ func (peer *Peer) RoutineNonce() { case <-peer.signals.flushNonceQueue: flush() - goto NextPacket + continue NextPacket case elem, ok := <-peer.queue.nonce: @@ -418,7 +418,7 @@ func (peer *Peer) RoutineNonce() { device.PutMessageBuffer(elem.buffer) device.PutOutboundElement(elem) flush() - goto NextPacket + continue NextPacket case <-peer.routines.stop: device.PutMessageBuffer(elem.buffer) @@ -439,7 +439,7 @@ func (peer *Peer) RoutineNonce() { atomic.StoreUint64(&keypair.sendNonce, RejectAfterMessages) device.PutMessageBuffer(elem.buffer) device.PutOutboundElement(elem) - goto NextPacket + continue NextPacket } elem.keypair = keypair |