package main import ( "fmt" "os" gohealthchecks "git.faercol.me/faercol/go-healthchecks" "github.com/spf13/cobra" ) var startCmd = &cobra.Command{ Use: "start", Short: "Signal the check has started", Long: ``, Run: func(cmd *cobra.Command, args []string) { check := parseCheckFlags() clt := gohealthchecks.NewPingClient(pingHost) err := clt.ReportStart(cmd.Context(), check) if err != nil { failf("Failed to notify start: %s\n", err) } else { fmt.Println("Notified check start") os.Exit(0) } }, } func init() { rootCmd.AddCommand(startCmd) }