singleflight and cancellation: the net package jus...
# dev
a
singleflight and cancellation: the net package just cancels cancellation:
Copy code
// We don't want a cancellation of ctx to affect the
	// lookupGroup operation. Otherwise if our context gets
	// canceled it might cause an error to be returned to a lookup
	// using a completely different context. However we need to preserve
	// only the values in context. See Issue 28600.
	lookupGroupCtx, lookupGroupCancel := context.WithCancel(withUnexpiredValuesPreserved(ctx))
https://github.com/golang/go/issues/36503 for why general merging of context is really (really) tricky.