Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PingCmd = &cobra.Command{ Use: "ping", Short: "Ping the server", Long: "Ping the server", Run: func(cmd *cobra.Command, args []string) { fmt.Println("ping called") if len(args) < 1 { log.Fatal("usage: ping host [timeout]") } host = args[0] if len(host) < 1 { log.Fatal("No host provided") } err := error(nil) timeout, err = strconv.Atoi(args[1]) if err != nil { log.Fatal("Invalid timeout") } if timeout < 1 { log.Fatal("Invalid timeout") } fmt.Println("host:", host) if host == "" { log.Fatal("No host provided") } ping() }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.