Skip to content

Commit

Permalink
Remove unnecessary loop and select when waiting on exitCh
Browse files Browse the repository at this point in the history
  • Loading branch information
hatahet committed Dec 14, 2019
1 parent f5559ac commit a9f3a58
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,8 @@ func main() {
}
go smtp.Listen(apiconf, exitCh)

for {
select {
case <-exitCh:
log.Printf("Received exit signal")
os.Exit(0)
}
}
<-exitCh
log.Printf("Received exit signal")
}

/*
Expand Down

0 comments on commit a9f3a58

Please sign in to comment.