golang判断ip是否在cidr
func IpContains(cidr string, ip string) bool { _, … 继续阅读 golang判断ip是否在cidr
func IpContains(cidr string, ip string) bool { _, … 继续阅读 golang判断ip是否在cidr
func TestRandomFile(tt *testing.T) { dirname := &q… 继续阅读 golang get dir info
err: panic: runtime error: invalid memory address … 继续阅读 golang http.ResponseWriter panic
// MapKey 知道值 拿第一个key func MapKey(m map[string]str… 继续阅读 golang get key from value
func RandMapKey(m map[string]string) string { mapK… 继续阅读 golang map get random value
func HTTPGet(url string) []byte { method := "… 继续阅读 golang http get
func CMDBool(name string, arg []string) bool { cmd… 继续阅读 golang exec Command
func handleTencent(w http.ResponseWriter, r *http.… 继续阅读 golang http handle ignore /favicon.ico
func TestGetFileInfo(tt *testing.T) { info, err :=… 继续阅读 golang os.Stat get file info
func GetRealIP(r *http.Request) (string, error) { … 继续阅读 golang获取请求ip
#运行当前目录及所有子目录下的测试用例 go test ./… #运行指定目录及所有子目录下的测… 继续阅读 golang test测试范围
func TestRuneType(tt *testing.T) { var str = "… 继续阅读 golang rune type
#reuntime/debug #GOGC可以通过GOGC环境变量(所有Go语言程序都能识别)或者r… 继续阅读 golang setup gogc
if find := strings.Contains(dp.String(), "/sn… 继续阅读 golang 字符串包含
mv /usr/local/go /usr/local/go_bak$(date +%Y%m%d%H… 继续阅读 go1.19rc1 install
go tool compile -S main.go
db, err := sql.Open("godror", `user=&quo… 继续阅读 golang godror use oracle cloud database
func FuzzConv(f *testing.F) { f.Fuzz(func(t *testi… 继续阅读 golang 1.18 Fuzz Test
删除go.sum 删除go.mod中老依赖行 go mod tidy刷新
// 读取配置文件信息 config := new(ConfigInfo) cfg, err := … 继续阅读 golang get struct from json file