From c2ea01b2aac6d1f5f7f49cfec2c3f105d6b97d56 Mon Sep 17 00:00:00 2001 From: Lester Guerzon Date: Mon, 30 Oct 2023 12:44:05 +0800 Subject: [PATCH] docs: minor wording and cleanup in graceful shutdown example --- content/en/docs/examples/graceful-restart-or-stop.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/content/en/docs/examples/graceful-restart-or-stop.md b/content/en/docs/examples/graceful-restart-or-stop.md index aae74ebd8..59b62acf9 100644 --- a/content/en/docs/examples/graceful-restart-or-stop.md +++ b/content/en/docs/examples/graceful-restart-or-stop.md @@ -21,7 +21,7 @@ An alternative to endless: * [graceful](https://github.com/tylerb/graceful): Graceful is a Go package enabling graceful shutdown of an http.Handler server. * [grace](https://github.com/facebookgo/grace): Graceful restart & zero downtime deploy for Go servers. -If you are using Go 1.8, you may not need to use this library! Consider using http.Server's built-in [Shutdown()](https://golang.org/pkg/net/http/#Server.Shutdown) method for graceful shutdowns. See the full [graceful-shutdown](https://github.com/gin-gonic/examples/tree/master/graceful-shutdown) example with gin. +If you are using Go 1.8 and later, you may not need to use this library! Consider using `http.Server`'s built-in [Shutdown()](https://golang.org/pkg/net/http/#Server.Shutdown) method for graceful shutdowns. See the full [graceful-shutdown](https://github.com/gin-gonic/examples/tree/master/graceful-shutdown) example with gin. ```go // +build go1.8 @@ -62,9 +62,8 @@ func main() { // Wait for interrupt signal to gracefully shutdown the server with // a timeout of 5 seconds. quit := make(chan os.Signal, 1) - // kill (no param) default send syscall.SIGTERM + // kill (no params) by default sends syscall.SIGTERM // kill -2 is syscall.SIGINT - // kill -9 is syscall. SIGKILL but can"t be catch, so don't need add it signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit log.Println("Shutdown Server ...")