golang 檢查網絡狀態是否正常

package main import ( "fmt" "os/exec" "time" ) func NetWorkStatus() bool { cmd := exec.Command("ping", "baidu.com", "-c", "1", "-W", "5") fmt.Println("NetWorkStatus Start:", time.Now().Unix())
相關文章
相關標籤/搜索