16 lines
149 B
Go
16 lines
149 B
Go
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
)
|
||
|
|
|
||
|
|
func process(ctx context.Context) {
|
||
|
|
if ctx.Err() != nil {
|
||
|
|
// handling...
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func main() {
|
||
|
|
process(nil)
|
||
|
|
}
|