From 3bc3731f7ddd50ac45b55e50e07e0a68e9c9f974 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ Date: Thu, 25 Jul 2019 14:18:52 +0800 Subject: [PATCH] refine code --- tool/kratos/template.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tool/kratos/template.go b/tool/kratos/template.go index e112b64b6..59c015a4b 100644 --- a/tool/kratos/template.go +++ b/tool/kratos/template.go @@ -142,8 +142,7 @@ func main() { httpSrv := http.New(svc) c := make(chan os.Signal, 1) signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT) - for { - s := <-c + for s := range c { log.Info("get a signal %s", s.String()) switch s { case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT: