esgo2dump/main.go

27 lines
446 B
Go
Raw Permalink Normal View History

2024-03-22 18:05:47 +08:00
package main
import (
"context"
"os/signal"
"syscall"
"github.com/loveuer/esgo2dump/pkg/log"
2024-03-26 17:23:10 +08:00
"github.com/loveuer/esgo2dump/internal/cmd"
2024-03-22 18:05:47 +08:00
)
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
defer cancel()
go func() {
<-ctx.Done()
log.Fatal(ctx.Err().Error())
}()
if err := cmd.Run(ctx); err != nil {
log.Error(err.Error())
2024-03-22 18:05:47 +08:00
return
}
}