mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
17 lines
176 B
Go
17 lines
176 B
Go
|
package common
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
)
|
||
|
|
||
|
func IsCanceled(ctx context.Context) bool {
|
||
|
select {
|
||
|
case <-ctx.Done():
|
||
|
return true
|
||
|
default:
|
||
|
// nothing to do
|
||
|
}
|
||
|
|
||
|
return false
|
||
|
}
|