Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 526 Bytes

File metadata and controls

27 lines (17 loc) · 526 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 - present Alex Klinkert