]> Cypherpunks.ru repositories - gostls13.git/commit
context: add WithoutCancel
authorSameer Ajmani <sameer@google.com>
Tue, 28 Mar 2023 21:44:18 +0000 (17:44 -0400)
committerSameer Ajmani <sameer@golang.org>
Wed, 29 Mar 2023 20:41:09 +0000 (20:41 +0000)
commit1844b541664525a0298603154915e74ca742e406
tree906703c13906f02bb9b811688bbe205858ec4aa2
parentc2923971600a89db65daee86858f5fc054322129
context: add WithoutCancel

WithoutCancel returns a copy of parent that is not canceled when parent is canceled.
The returned context returns no Deadline or Err, and its Done channel is nil.
Calling Cause on the returned context returns nil.

API changes:
+pkg context, func WithoutCancel(Context) Context

Fixes #40221

Change-Id: Ide29631c08881176a2c2a58409fed9ca6072e65d
Reviewed-on: https://go-review.googlesource.com/c/go/+/479918
Run-TryBot: Sameer Ajmani <sameer@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
api/next/40221.txt [new file with mode: 0644]
src/context/context.go
src/context/context_test.go
src/context/x_test.go