1、http客户端编程 示例: http_server.go package main import ( "fmt" "net/http" ) //w, 给客户端回复数据 //r, 读取客户端发送的数据 func HandConn(w http ...
http服务器获取客户端的一些信息 示例: package main import fmt net http w, 给客户端回复数据 r, 读取客户端发送的数据 func HandConn w http.ResponseWriter, r http.Request fmt.Println r.Method , r.Method fmt.Println r.URL , r.URL fmt.Prin ...
2019-01-26 14:52 0 647 推荐指数:
1、http客户端编程 示例: http_server.go package main import ( "fmt" "net/http" ) //w, 给客户端回复数据 //r, 读取客户端发送的数据 func HandConn(w http ...
1、定时器停止 示例: package main import ( "fmt" "time" ) func main() { timer := time.NewTimer(3 * time.Second) go func() { <-timer.C ...
服务端: 客户端: ...
1、方法的重写 示例: //Person类型,实现了一个方法 func (tmp *Person) PrintInfo() { fmt.Printf("name=%s, sex=%c, a ...
1、json解析到结构体 示例: package main import ( "encoding/json" "fmt" ) type IT struct { Company s ...
1、recover的使用 示例: package main import "fmt" func testa() { fmt.Println("aaaaaaaaaaaaaaaaa") } ...
1、字符串转换 示例: package main import ( "fmt" "strconv" ) func main() { //转换为字符串后追加到字节数组 slice ...
[0] = 1 //int i[1] = "hello go" ...