From 9fc5eb2f721e9989b1ebd2c417c253313cd23d48 Mon Sep 17 00:00:00 2001 From: Kenneth Tan Xin You Date: Wed, 7 Oct 2020 17:03:15 +0800 Subject: [PATCH] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a86248..02d7e3f 100644 --- a/README.md +++ b/README.md @@ -455,6 +455,7 @@ import ( ) func main() { + defer os.Exit(0) var wait time.Duration flag.DurationVar(&wait, "graceful-timeout", time.Second * 15, "the duration for which the server gracefully wait for existing connections to finish - e.g. 15s or 1m") flag.Parse() @@ -496,7 +497,6 @@ func main() { // <-ctx.Done() if your application should wait for other services // to finalize based on context cancellation. log.Println("shutting down") - defer os.Exit(0) } ```