Skip to content

Commit 64a495c

Browse files
committed
lean on stdlib to end better
1 parent c415cd1 commit 64a495c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

content/advent-2019/directional-channels.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ Here, the user is expected to pre-allocate an `os.Signal` channel for receiving
186186
func Notify(depth uint, sig ...os.Signal) <-chan os.Signal
187187
```
188188

189-
Which returns a receive-only channel, similarly to how package `time` operates. The only difference is by taking a channel as an argument, package `os/signal` can keep track of the user's notify channels, allowing for the multiple calls it mentions to expand the set of signals the channel will receive, or calling `Stop()` to cease them.
190-
191-
This is a very specific use case, however, so you're better off finding another way to support something like this, if you can.
189+
Which returns a receive-only channel, similarly to how package `time` operates. The only difference is by taking a channel as an argument, package `os/signal` can keep track of the user's notify channels, allowing for the multiple calls it mentions to expand the set of signals the channel will receive, or calling `Stop()` to cease them. This is not possible without taking a channel as an argument, so in this case, a send-only channel is the way to go.
192190

193191
## Conclusion
194192

0 commit comments

Comments
 (0)