main test
This commit is contained in:
12
main.go
12
main.go
@@ -8,10 +8,14 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx, can := signal.NotifyContext(context.Background(), syscall.SIGINT)
|
||||
defer can()
|
||||
|
||||
if err := cmd.Main(ctx); err != nil {
|
||||
if err := Main(context.Background()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func Main(ctx context.Context) error {
|
||||
ctx, can := signal.NotifyContext(ctx, syscall.SIGINT)
|
||||
defer can()
|
||||
|
||||
return cmd.Main(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user