You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
311 B
Go
17 lines
311 B
Go
2 years ago
|
package exegroup_test
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"git.blauwelle.com/go/crate/exegroup"
|
||
|
"log"
|
||
|
)
|
||
|
|
||
|
func Example_defaultGroup() {
|
||
|
g := exegroup.Default()
|
||
|
g.New().WithName("do nothing").WithGo(func(ctx context.Context) error {
|
||
|
<-ctx.Done()
|
||
|
return ctx.Err()
|
||
|
})
|
||
|
log.Println("exit:", g.Run(context.Background()))
|
||
|
}
|