style:包名小写

This commit is contained in:
Mmx
2021-07-11 12:02:42 +08:00
parent 78e9aa9ec3
commit e3f668c100
14 changed files with 51 additions and 50 deletions

23
util/checker.go Normal file
View File

@@ -0,0 +1,23 @@
package util
import (
"context"
"net"
)
type checker struct{}
var Checker checker
func (checker) NetOk() bool {
r := &net.Resolver{ //指定DNS防止本地DNS缓存影响
PreferGo: true,
Dial: NetDailEr(),
}
if ip, err := r.LookupIP(context.Background(), "ip4", "www.msftconnecttest.com"); err != nil { //通过DNS确认是否在线
return false
} else if len(ip) == 0 || ip[0].String() != "13.107.4.52" {
return false
}
return true
}