-
Notifications
You must be signed in to change notification settings - Fork 19.1k
proposal: os/signal: NotifyContext should pass the signal as a cause #76153
Copy link
Copy link
Closed as duplicate of#60756
Closed as duplicate of#60756
Copy link
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Metadata
Metadata
Assignees
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Proposal Details
Propose to:
change the type signature of signal.NotifyContext() to be: func(context.Context, ...os.Signal) (context.Context, context.CancelCauseFunc)
modify the implementation so that, when the context is cancelled due to receipt of a signal, context.Cause(ctx) should return a suitably defined error identifying the specific signal that caused the cancellation