package main import ( "context" "github.com/loveuer/nfflow/internal/cmd" "github.com/loveuer/nfflow/internal/util" "github.com/sirupsen/logrus" "os/signal" "syscall" ) func main() { ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) defer cancel() if err := cmd.Execute(ctx); err != nil { logrus.Errorf("cmd.Execute: err=%v", err) } logrus.Warn("received quit signal...(2s)") <-util.Timeout(2).Done() }