core: use context.WithoutCancel (#4959)

This commit is contained in:
Caleb Doxsey 2024-02-09 13:55:06 -07:00 committed by GitHub
parent 6b245d2a24
commit 76862c2fe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 25 deletions

View file

@ -64,25 +64,3 @@ func (mc *mergedCtx) Value(key interface{}) interface{} {
}
return mc.doneCtx.Value(key)
}
type onlyValues struct {
context.Context
}
// OnlyValues returns a derived context that removes deadlines and cancellation,
// but keeps values.
func OnlyValues(ctx context.Context) context.Context {
return onlyValues{ctx}
}
func (o onlyValues) Deadline() (time.Time, bool) {
return time.Time{}, false
}
func (o onlyValues) Done() <-chan struct{} {
return nil
}
func (o onlyValues) Err() error {
return nil
}