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)
|
sig := make(chan os.Signal)
|
||||||
signal.Notify(sig, os.Interrupt)
|
signal.Notify(sig, os.Interrupt)
|
||||||
|
<-sig
|
||||||
for s := range sig {
|
|
||||||
if s == os.Interrupt {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user