mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-06-13 15:47:38 +08:00
Compare commits
2 commits
8dc7d8c136
...
ef965f4a6a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef965f4a6a | ||
|
|
d90d043811 |
1 changed files with 6 additions and 1 deletions
|
|
@ -75,7 +75,12 @@ func MergeCtx(parents ...context.Context) (ctx context.Context, cancel context.C
|
||||||
|
|
||||||
// Value 返回当前Ctx Value
|
// Value 返回当前Ctx Value
|
||||||
func (mc *mergedContext) Value(key any) any {
|
func (mc *mergedContext) Value(key any) any {
|
||||||
return mc.Context.Value(key)
|
for _, p := range mc.parents {
|
||||||
|
if val := p.Value(key); val != nil {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deadline 实现了 context.Context 的 Deadline 方法.
|
// Deadline 实现了 context.Context 的 Deadline 方法.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue