We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c64c21 commit 48d20dcCopy full SHA for 48d20dc
internals/cli/cmd_logs.go
@@ -107,9 +107,9 @@ func (cmd *cmdLogs) Execute(args []string) error {
107
// Needed because signal.NotifyContext is Go 1.16+
108
func notifyContext(parent context.Context, signals ...os.Signal) context.Context {
109
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).
+ // Need a buffered channel in case the signal arrives between the
+ // signal.Notify call and the goroutine waiting on the channel. In
+ // cmd_run.go Pebble uses a buffer size of 2, so be consistent.
113
ch := make(chan os.Signal, 2)
114
signal.Notify(ch, signals...)
115
go func() {
0 commit comments