INNER CODE UNIT · Go

Execute

Netis/cloud-probe · cpctl/cmd/base.go:149

func Execute() {
	var err error
	defer func() {
		if err == nil {
			return
		}
		initLogger()
		reportError(slog.Default(), err)
		os.Exit(1)
	}()

	ctx, cancel := context.WithCancel(context.Background())
	go func() {
		c := make(chan os.Signal, 1)
		signal.Notify(c, syscall.SIGINT, syscall.SIGHUP, syscall.SIGTERM)
		sig := <-c
		slog.Info("received signal", slog.String("signal", sig.String()))
		cancel()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…