随笔分类 -  Go

参考:《Go Web 编程》
摘要:1. 标准库 标准库math中定义了各种数字类型的取值范围 const ( MaxInt8 = 1<<7 - 1 MinInt8 = -1 << 7 MaxInt16 = 1<<15 - 1 MinInt16 = -1 << 15 MaxInt32 = 1<<31 - 1 MinInt32 = -1 阅读全文
posted @ 2020-12-19 22:54 yvhqbat 阅读(81) 评论(0) 推荐(0) 编辑
摘要:``` package main import ( "context" "fmt" "io" "io/ioutil" "log" "net" "net/http" "time" ) var handlersMap = make(map[string]http.HandlerFunc) func f1 阅读全文
posted @ 2019-02-18 20:03 yvhqbat 阅读(1385) 评论(0) 推荐(0) 编辑
摘要:http.FileServer实现静态文件服务 阅读全文
posted @ 2019-01-03 00:32 yvhqbat 阅读(98) 评论(0) 推荐(0) 编辑
摘要:``` package main import ( "fmt" "net/http" ) type DB struct{ name string age int } var gdb DB = DB{"catty",26} func get(w http.ResponseWriter, req *http.Request) { // The "/" pattern matches ... 阅读全文
posted @ 2019-01-02 20:35 yvhqbat 阅读(351) 评论(0) 推荐(0) 编辑
摘要:包 阅读全文
posted @ 2018-12-28 20:50 yvhqbat 阅读(160) 评论(0) 推荐(0) 编辑
摘要:go连接redis 阅读全文
posted @ 2018-12-13 17:06 yvhqbat 阅读(174) 评论(0) 推荐(0) 编辑
摘要:go连接Mysql 阅读全文
posted @ 2018-12-13 16:49 yvhqbat 阅读(211) 评论(0) 推荐(0) 编辑
摘要:参考: "Go语言完整的学习路线图" 阅读全文
posted @ 2018-12-11 21:53 yvhqbat 阅读(319) 评论(0) 推荐(0) 编辑
摘要:参考: 《Go Web 编程》 1. go 实现的基于REST的Web服务 go // webserver project server.go package main import ( "encoding/json" "fmt" "net/http" //"strconv" ) type Post 阅读全文
posted @ 2018-08-26 21:43 yvhqbat 阅读(1209) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示