Registry / utility / caarlos0-ctrlc

caarlos0-ctrlc

JSON →
library1.2.0gogounverified

Package ctrlc provides an easy way of having a task that is context-aware and that also deals with interrupt and term signals.

go get github.com/caarlos0/ctrlc
INSTALL
IMPORT
SIG · CAARLOS0-CTRLC
C
caarlos0-ctrlc
utilitygov1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ctrlc
github.com/caarlos0/ctrlc

Runs a function with automatic handling of Ctrl+C and context cancellation.

package main import ( "context" "fmt" "github.com/caarlos0/ctrlc" ) func main() { ctrlc.Default.Run(context.Background(), func(ctx context.Context) error { fmt.Println("Running...") return nil }) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.2.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
caarlos0-ctrlc — go get caarlos0-ctrlc · libregistry