Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 521 Bytes

README.md

File metadata and controls

25 lines (15 loc) · 521 Bytes

go-exitcontext

This package provides functions to create a context that listens for SIG_ signals and cancels the context, used to abort programs by sending signals.

Usage

If you already have a context and want to recycle that one:

ctx := context.Background()
exitCtx := exitcontext.NewWithContext(ctx)

else just use the new method, which creates a context.Background() under the hood:

exitCtx := exitcontext.New()

License

MIT License

Copyright (c) 2019 Alexander Pinnecke