程序如下,报错了,为什么呢?
```go
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)
}
}
```
有疑问加站长微信联系(非本文作者)