From 75dafaeacc5e7996404d4eeb2c2bc77b82a412cc Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Fri, 18 Feb 2022 06:11:30 -0800 Subject: [PATCH] docs: remove unnecessary os.Exit calls at the end of main (#7861) The main function defers some things that do not run in the "normal" exit case because we call os.Exit(0) explicitly. Since falling off the end of main does the same thing, and also permits defers to run, let's do that. --- docs/tutorials/go.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/tutorials/go.md b/docs/tutorials/go.md index d5c610b4d..b888deae3 100644 --- a/docs/tutorials/go.md +++ b/docs/tutorials/go.md @@ -384,7 +384,6 @@ func main() { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) <-c - os.Exit(0) } ``` @@ -425,7 +424,6 @@ defer server.Stop() c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) <-c -os.Exit(0) ``` ## 1.5 Getting Up and Running