Skip to content

proposal: os/signal: NotifyContext should pass the signal as a cause #76153

@lbcjones

Description

@lbcjones

Proposal Details

Propose to:

  1. change the type signature of signal.NotifyContext() to be: func(context.Context, ...os.Signal) (context.Context, context.CancelCauseFunc)

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues 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.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions