diff --git a/example_test.go b/example_test.go index 61b2bf5..727edb7 100644 --- a/example_test.go +++ b/example_test.go @@ -22,8 +22,10 @@ func ExampleStart() { } func ExampleStart_startWithCancelContext() { - f := func(context.Context) error { + f := func(ctx context.Context) error { <-time.After(time.Second) + workerId := cogroup.GetWorkerId(ctx) + println(workerId, " did one task") return nil }