CasaOS/pkg/utils/ctx.go
2023-01-16 05:54:44 +00:00

14 lines
156 B
Go

package utils
import (
"context"
)
func IsCanceled(ctx context.Context) bool {
select {
case <-ctx.Done():
return true
default:
return false
}
}