func main() {
if err := Main(); err != nil {
log.Fatal(err)
}
}
func Main() error {
ctx, cancel := cintext.WithCanvel(context.Background())
defer cancel()
sigCh := make(chan signal.Signal, 1)
go func() {
<-sigCh
cancel()
}
signal.Notify(sigCh, signal.Interrupt)
...
return nil
}
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.