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