From c6694e0f1aeccfd7bbfbf1d03c12a226cfccd4c5 Mon Sep 17 00:00:00 2001 From: jejayhe Date: Thu, 16 Apr 2020 10:24:11 +0800 Subject: [PATCH] Some code optimization os.Kill is non-catchable, non-ignorable --- main/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/main.go b/main/main.go index fe13c3d1..5f38d38f 100644 --- a/main/main.go +++ b/main/main.go @@ -29,7 +29,7 @@ var ( format = flag.String("format", "json", "Format of input file.") /* We have to do this here because Golang's Test will also need to parse flag, before - main func in this file is run. + main func in this file is run. */ _ = func() error { @@ -166,7 +166,7 @@ func main() { { osSignals := make(chan os.Signal, 1) - signal.Notify(osSignals, os.Interrupt, os.Kill, syscall.SIGTERM) + signal.Notify(osSignals, os.Interrupt, syscall.SIGTERM) <-osSignals } }