From 082c302ca6b7991c3bca835e5d4f3fd618937e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn?= Date: Mon, 15 Jul 2019 20:45:32 +0200 Subject: [PATCH] Log os signals as info and exit with 0 (#28) When receiving SIGINT or SIGTERM the application is expected to terminate and thus not exit with 1. This change makes the application log the signal and exit with 0. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0057f21..e626672 100644 --- a/main.go +++ b/main.go @@ -108,7 +108,8 @@ func main() { go func() { select { case sig := <-sigs: - done <- fmt.Errorf("received os signal '%s'", sig) + log.Infof("Received os signal '%s'. Terminating...", sig) + done <- nil } }()