Исходники и презентации
This commit is contained in:
15
lessons/contexts/nil_context/main.go
Normal file
15
lessons/contexts/nil_context/main.go
Normal file
@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
func process(ctx context.Context) {
|
||||
if ctx.Err() != nil {
|
||||
// handling...
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
process(nil)
|
||||
}
|
||||
Reference in New Issue
Block a user