Skip to content

Commit

Permalink
Use simple channel receive instead of select
Browse files Browse the repository at this point in the history
Address a report by staticcheck: should use a simple channel
send/receive instead of select with a single case (S1000).
  • Loading branch information
hansmi committed Dec 25, 2022
1 parent 3a99137 commit 4ed70cb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions luxws/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@ func (t *transport) Close() error {
}

// Wait for receiver to terminate
select {
case <-t.recvDone:
t.mu.Lock()
t.recvErr = net.ErrClosed
t.mu.Unlock()
}
<-t.recvDone

t.mu.Lock()
t.recvErr = net.ErrClosed
t.mu.Unlock()

return nil
}
Expand Down

0 comments on commit 4ed70cb

Please sign in to comment.