Skip to content

Commit 48d20dc

Browse files
authored
Fix comment about channel buffer size in cmd_logs.go (canonical#233)
1 parent 0c64c21 commit 48d20dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internals/cli/cmd_logs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ func (cmd *cmdLogs) Execute(args []string) error {
107107
// Needed because signal.NotifyContext is Go 1.16+
108108
func notifyContext(parent context.Context, signals ...os.Signal) context.Context {
109109
ctx, cancel := context.WithCancel(parent)
110-
// This channel doesn't really need to be buffered here, but it shuts up
111-
// "go vet" (and other places in Pebble use a buffer size of 2, so be
112-
// consistent).
110+
// Need a buffered channel in case the signal arrives between the
111+
// signal.Notify call and the goroutine waiting on the channel. In
112+
// cmd_run.go Pebble uses a buffer size of 2, so be consistent.
113113
ch := make(chan os.Signal, 2)
114114
signal.Notify(ch, signals...)
115115
go func() {

0 commit comments

Comments
 (0)