Help us shape the future of Go! Take the 2026 Go Developer Survey

command

package
v0.38.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotifyShutdownSignals added in v0.31.0

func NotifyShutdownSignals(parent context.Context) (context.Context, context.CancelFunc)

NotifyShutdownSignals derives a context that ends when the process is asked to stop, and hands the signals back to the runtime once that has happened.

Handing them back is the difference from signal.NotifyContext, which leaves the handler installed with nothing draining its channel: a second Ctrl-C, or a second SIGTERM aimed at a shutdown that has wedged, is swallowed, and the operator who meant "stop now" is left reaching for SIGKILL. Restoring the default disposition makes the second signal do what sending it twice means. It is also what oklog/run's SignalHandler does, via the signal.Stop it defers around its own channel.

func Root

func Root() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL