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.
This commit is contained in:
M. J. Fromberger
2022-02-18 06:11:30 -08:00
committed by GitHub
parent 6280f45460
commit 75dafaeacc

View File

@@ -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