From 2a947d40d7705ae166337adcc911ce6e3a0ed1f2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 00:40:15 +0300 Subject: 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. --- internal/repl/signal.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal') 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 -- cgit v1.2.3