From: Cuong Manh Le Date: Tue, 1 Dec 2020 15:23:42 +0000 (+0700) Subject: doc: update signal.Notify example to use buffered channel X-Git-Tag: go1.16beta1~116 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5984ea71977d8436436a096902a32974b958c0bb;p=gostls13.git doc: update signal.Notify example to use buffered channel This if follow up of CL 274332. Updates #9399. Change-Id: Ic6dd534dc18227a799cbb9577979f2285596b825 Reviewed-on: https://go-review.googlesource.com/c/go/+/274393 Trust: Cuong Manh Le Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- diff --git a/doc/go1.html b/doc/go1.html index 34e305b93c..939ee24df5 100644 --- a/doc/go1.html +++ b/doc/go1.html @@ -1647,14 +1647,14 @@ c := signal.Incoming() is

-c := make(chan os.Signal)
+c := make(chan os.Signal, 1)
 signal.Notify(c) // ask for all signals
 

but most code should list the specific signals it wants to handle instead:

-c := make(chan os.Signal)
+c := make(chan os.Signal, 1)
 signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)