lint: simplify code (gosimple)

Replaces infinite for loops containing a select on a channel with a
single case with a range over the channel.

Removes redundant assignments to blank identifiers.

Remove unnecessary guard clause around delete().

Remove `if condition { return true } return false` with return condition

Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Moritz Poldrack 2022-07-29 21:42:02 +02:00 committed by Robin Jarry
parent 03f9f4c3ab
commit ef599aa8fc
6 changed files with 28 additions and 39 deletions
commands/mode

View file

@ -19,8 +19,5 @@ func NoQuitDone() {
// QuitAllowed checks if aerc can exit normally (only when all goroutines that
// requested a no-quit mode were done and called the NoQuitDone() function)
func QuitAllowed() bool {
if atomic.LoadInt32(&noquit) > 0 {
return false
}
return true
return atomic.LoadInt32(&noquit) <= 0
}