Use less code to catch the interrupt signal
This commit is contained in:
parent
a2bfadfa66
commit
86c1b42540
|
@ -26,10 +26,5 @@ func main() {
|
|||
|
||||
sig := make(chan os.Signal)
|
||||
signal.Notify(sig, os.Interrupt)
|
||||
|
||||
for s := range sig {
|
||||
if s == os.Interrupt {
|
||||
return
|
||||
}
|
||||
}
|
||||
<-sig
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue