摘要:
Day 10 http 编程 Go 原生支持 http, import "net/http" Go 的 http 服务性能和 nginx 比较接近 几行代码就可以实现一个 web 服务 简单的例子 package main import ( "fmt" "net/http" ) func Hello 阅读全文
摘要:
package main import ( "fmt" _ "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" ) var Db *sqlx.DB func init() { database, err := sqlx.Open("m 阅读全文
摘要:
package main import ( "fmt" "net/http" ) func Hello(w http.ResponseWriter, r *http.Request) { fmt.Println("handle hello 123") fmt.Fprintf(w, "hello 45 阅读全文