diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-24 00:40:15 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-24 00:40:15 +0300 |
| commit | 2a947d40d7705ae166337adcc911ce6e3a0ed1f2 (patch) | |
| tree | 08cfaa6f8147abbe6422fa07f3c39a3178e8285e | |
| parent | 78e57d37bdaa787372a1e21647057428aa4ad90b (diff) | |
docs: fix inaccurate Start comment in internal/repl/signal.go
The comment claimed Start blocks until Stop is called, but Start
launches a goroutine and returns immediately. Updated the doc comment
to accurately describe the non-blocking behavior.
| -rw-r--r-- | internal/repl/signal.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/repl/signal.go b/internal/repl/signal.go index 3bffd28..4c756ff 100644 --- a/internal/repl/signal.go +++ b/internal/repl/signal.go @@ -27,12 +27,11 @@ func NewSignalHandler() *SignalHandler { } } -// Start starts the signal handler goroutine with the given callback. -// When SIGINT is received, the callback function is executed in the goroutine. -// The function blocks until Stop is called. +// Start launches a goroutine that waits for SIGINT and then runs the callback. +// Start returns immediately; the goroutine blocks until a signal is received or +// Stop is called (which prevents further signals from being delivered). // // callback: the function to execute when SIGINT is received -// Returns: no return value; executes callback in a separate goroutine func (s *SignalHandler) Start(callback func()) { go func() { <-s.sigChan |
