Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit 310da2b

Browse files
removed the calling AutoCancel from NewTerminateContext
1 parent bdbcad7 commit 310da2b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

terminatecontext.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ func (c *terminateContext) Terminate() {
2121
}
2222

2323
// NewTerminateContext returns the underlying context as TerminateContext.
24-
// It cancels the context when it was done through parent, deadline, timeout or in any way.
2524
// The code should call Terminate method or cancel function to release resources associated with it.
2625
func NewTerminateContext(ctx context.Context, cancel context.CancelFunc) TerminateContext {
2726
result := new(terminateContext)
2827
result.Context, result.CancelFunc = ctx, cancel
29-
AutoCancel(ctx, cancel)
3028
return result
3129
}
3230

3331
// WithTerminate creates a new cancel context as TerminateContext.
34-
// It cancels the context when it was done through parent.
3532
// The code should call Terminate method to release resources associated with it, as cancel function.
3633
func WithTerminate(parent context.Context) TerminateContext {
3734
return NewTerminateContext(context.WithCancel(parent))

0 commit comments

Comments
 (0)