os/signal: add Notify windows documentation

Add that Notify only accepts os.Interrupt signal on windows.

Updates #77076

Change-Id: I09a3ae68d198d615f12ee7de6082c4993f39f140
Reviewed-on: https://go-review.googlesource.com/c/go/+/770920
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Alex Brainman 2026-04-27 15:28:32 +10:00
parent a63b23ffb2
commit 5bb6d165f0

View file

@ -213,8 +213,9 @@ before raising the signal.
On Windows a ^C (Control-C) or ^BREAK (Control-Break) normally cause
the program to exit. If Notify is called for [os.Interrupt], ^C or ^BREAK
will cause [os.Interrupt] to be sent on the channel, and the program will
not exit. If Reset is called, or Stop is called on all channels passed
to Notify, then the default behavior will be restored.
not exit. [os.Interrupt] is the only signal that can be used on Windows.
If Reset is called, or Stop is called on all channels passed to Notify,
then the default behavior will be restored.
Additionally, if Notify is called, and Windows sends CTRL_CLOSE_EVENT,
CTRL_LOGOFF_EVENT or CTRL_SHUTDOWN_EVENT to the process, Notify will