mirror of https://github.com/Xhofe/alist
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
|
||
|
}
|
||
|
}
|