From 5984ea71977d8436436a096902a32974b958c0bb Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 1 Dec 2020 22:23:42 +0700 Subject: [PATCH] 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 --- doc/go1.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)
 
-- 2.50.0