mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-20 20:56:20 +08:00
13 lines
151 B
Go
13 lines
151 B
Go
![]() |
package utils
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
func IsCanceled(ctx context.Context) bool {
|
||
|
select {
|
||
|
case <-ctx.Done():
|
||
|
return true
|
||
|
default:
|
||
|
return false
|
||
|
}
|
||
|
}
|