diff options
Diffstat (limited to 'vendor/codeberg.org/gruf/go-runners/context.go')
-rw-r--r-- | vendor/codeberg.org/gruf/go-runners/context.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/codeberg.org/gruf/go-runners/context.go b/vendor/codeberg.org/gruf/go-runners/context.go index edb695060..6a0c509cb 100644 --- a/vendor/codeberg.org/gruf/go-runners/context.go +++ b/vendor/codeberg.org/gruf/go-runners/context.go @@ -5,6 +5,13 @@ import ( "time" ) +// closedctx is an always closed context. +var closedctx = func() context.Context { + ctx := make(cancelctx) + close(ctx) + return ctx +}() + // ContextWithCancel returns a new context.Context impl with cancel. func ContextWithCancel() (context.Context, context.CancelFunc) { ctx := make(cancelctx) |