Skip to content

go1.26: Consider using signal.NotifyContext instead of cmd.CatchSignals #8542

@aarongable

Description

@aarongable

We have our own custom scaffolding (cmd.CatchSignals) which listens for certain signals and then calls a cleanup function which is expected (but not required) to cause the process to shut down. It would be more idiomatic, and safer, to use signal.NotifyContext and pass that context into all long-running server routines which need to be shut down by a signal.

Read more: https://antonz.org/go-1-26/#signal-cause

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions