程序如下,报错了,为什么呢?
package main
import (
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("ping", "127.0.0.1", "-c 1 -W 1")
out, err := cmd.Output()
if err != nil {
fmt.Println("Command Error!", err.Error())
} else {
fmt.Println(out)
}
}