| 1 | // Copyright 2019 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package xcontext is a package to offer the extra functionality we need |
| 6 | // from contexts that is not available from the standard context package. |
| 7 | package xcontextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/ |
| 8 | |
| 9 | import ( |
| 10 | "contextscip-go gomod github.com/golang/go/src go1.25.0 context/" |
| 11 | "timescip-go gomod github.com/golang/go/src go1.25.0 time/" |
| 12 | ) |
| 13 | |
| 14 | // Detach returns a context that keeps all the values of its parent context |
| 15 | // but detaches from the cancellation and error handling. |
| 16 | func Detachscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/Detach().(ctx contextscip-go gomod github.com/golang/go/src go1.25.0 context/.Contextscip-go gomod github.com/golang/go/src go1.25.0 context/Context#) contextscip-go gomod github.com/golang/go/src go1.25.0 context/.Contextscip-go gomod github.com/golang/go/src go1.25.0 context/Context# { return detachedContextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#{ctx} } |
| 17 | |
| 18 | type detachedContextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext# struct{ parentscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#parent. contextscip-go gomod github.com/golang/go/src go1.25.0 context/.Contextscip-go gomod github.com/golang/go/src go1.25.0 context/Context# } |
| 19 | |
| 20 | func (v detachedContextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#) Deadlinescip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#Deadline().() (timescip-go gomod github.com/golang/go/src go1.25.0 time/.Timescip-go gomod github.com/golang/go/src go1.25.0 time/Time#, bool) { return timescip-go gomod github.com/golang/go/src go1.25.0 time/.Timescip-go gomod github.com/golang/go/src go1.25.0 time/Time#{}, false } |
| 21 | func (v detachedContextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#) Donescip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#Done().() <-chan struct{} { return nil } |
| 22 | func (v detachedContextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#) Errscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#Err().() error { return nil } |
| 23 | func (v detachedContextscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#) Valuescip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#Value().(key any) any { return v.parentscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/xcontext`/detachedContext#parent..Valuescip-go gomod github.com/golang/go/src go1.25.0 context/Context#Value().(key) } |