signal.NotifyContext - Does it expose the signal handled?

151 views
Skip to first unread message

Amit Saha

unread,
May 13, 2021, 4:54:39 PM5/13/21
to golang-nuts
Hi - i took a brief look and it doesn't look like we can access the
signal that was handled via the signal.NotifyContext() function call?
It could be useful for logging messages.

Vladimir Varankin

unread,
May 14, 2021, 10:48:21 AM5/14/21
to golang-nuts
I don't think the current API provides that functionality.

In the original proposal for signal.NotifyContext, there were several discussions, including related to what features the new API should provide. The consensus was that if a user wants to make a decision base on the signal caught, they should use "signal.Notify", as the low-level API, which allows that (refer to this issue https://github.com/golang/go/issues/37255).

Amit Saha

unread,
May 21, 2021, 11:00:52 PM5/21/21
to Vladimir Varankin, golang-nuts
Thanks.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b7b21dd2-b12a-4a01-b2f0-3dee10778cd1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages