Skip to content

Commit 5984ea7

Browse files
committed
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 <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 10240b9 commit 5984ea7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/go1.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,14 +1647,14 @@ <h3 id="os_signal">The os/signal package</h3>
16471647
is
16481648
</p>
16491649
<pre>
1650-
c := make(chan os.Signal)
1650+
c := make(chan os.Signal, 1)
16511651
signal.Notify(c) // ask for all signals
16521652
</pre>
16531653
<p>
16541654
but most code should list the specific signals it wants to handle instead:
16551655
</p>
16561656
<pre>
1657-
c := make(chan os.Signal)
1657+
c := make(chan os.Signal, 1)
16581658
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
16591659
</pre>
16601660

0 commit comments

Comments
 (0)