mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-10-11 09:48:10 +08:00
13 lines
228 B
Go
13 lines
228 B
Go
//go:build !go1.21
|
|
|
|
package contextutils
|
|
|
|
import "context"
|
|
|
|
func WithoutCancel(parent context.Context) context.Context {
|
|
if parent == nil {
|
|
panic("cannot create context from nil parent")
|
|
}
|
|
return withoutCancelCtx{parent}
|
|
}
|