摘要: 5.7 安装 下载 https://downloads.mysql.com/archives/community/ 官网下载比较慢,国内镜像站可以加速下载,下载完成校验md5是否一致 http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/ 阅读全文
posted @ 2018-03-27 01:09 cucy_to 阅读(198) 评论(0) 推荐(0)
摘要: go package main import ( "bufio" "context" "fmt" "log" "strings" "golang.org/x/sync/errgroup" ) const data = `line one line two with more words error: 阅读全文
posted @ 2018-03-27 01:06 cucy_to 阅读(225) 评论(0) 推荐(0)
摘要: go package main import ( "context" "fmt" "sync" "time" ) type SearchSrc struct { ID string Delay int } func (s SearchSrc) Search(ctx context.Context) 阅读全文
posted @ 2018-03-27 00:58 cucy_to 阅读(139) 评论(0) 推荐(0)
摘要: go package main import "sync" import "fmt" func main() { wg := sync.WaitGroup{} for i := 0; i 阅读全文
posted @ 2018-03-27 00:53 cucy_to 阅读(138) 评论(0) 推荐(0)
摘要: go package main import "sync" import "fmt" import "time" type Worker struct { id string } func (w Worker) String() string { return w.id } var globalCo 阅读全文
posted @ 2018-03-27 00:47 cucy_to 阅读(190) 评论(0) 推荐(0)
摘要: go package main import ( "fmt" "sync" "time" ) var names = []interface{}{"Alan", "Joe", "Jack", "Ben", "Ellen", "Lisa", "Carl", "Steve", "Anton", "Yo" 阅读全文
posted @ 2018-03-27 00:42 cucy_to 阅读(202) 评论(0) 推荐(0)
摘要: go package main import ( "fmt" "sync" ) var names = []string{"Alan", "Joe", "Jack", "Ben", "Ellen", "Lisa", "Carl", "Steve", "Anton", "Yo"} func main( 阅读全文
posted @ 2018-03-27 00:37 cucy_to 阅读(129) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "sync" ) var names = []string{"Alan", "Joe", "Jack", "Ben", "Ellen", "Lisa", "Carl", "Steve", "Anton", "Yo"} type Sy 阅读全文
posted @ 2018-03-27 00:31 cucy_to 阅读(125) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "net/http" ) type StringServer string func (s StringServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) { fmt.Printf("Prior ParseForm: %v\n", req.Form... 阅读全文
posted @ 2018-03-27 00:27 cucy_to 阅读(121) 评论(0) 推荐(0)
摘要: ```go Prepare the private key and self-signed X-509 certificate. For this purpose, the OpenSSL utility could be used. By executing the command openssl genrsa -out server.key 2048, the private key deri... 阅读全文
posted @ 2018-03-27 00:24 cucy_to 阅读(331) 评论(0) 推荐(0)
摘要: ```go package main import ( "context" "fmt" "log" "net/http" "os" "os/signal" "time" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", fun 阅读全文
posted @ 2018-03-27 00:21 cucy_to 阅读(233) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "log" "net/http" "time" ) const cookieName = "X-Cookie" func main() { log.Println("Server is starting...") http.HandleFunc("/set", func(w http.ResponseWrite... 阅读全文
posted @ 2018-03-27 00:17 cucy_to 阅读(110) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "log" "net/http" ) func main() { log.Println("Server is starting...") http.Handle("/secured/handle", http.RedirectHa 阅读全文
posted @ 2018-03-27 00:14 cucy_to 阅读(164) 评论(0) 推荐(0)
摘要: ```go ➜ recipe08 cat template.tpl Hi, I'm {{.}}! ``` ```go package main import "net/http" import "html/template" import "fmt" func main() { fmt.Println("Server is starting..."... 阅读全文
posted @ 2018-03-27 00:10 cucy_to 阅读(114) 评论(0) 推荐(0)
摘要: ``` ➜ recipe07 tree . . ├── html │ └── page.html ├── static.go └── welcome.txt 1 directory, 3 files ``` ```go package main import ( "net/http" ) func main() { fileSrv := http.FileServer(htt... 阅读全文
posted @ 2018-03-27 00:08 cucy_to 阅读(103) 评论(0) 推荐(0)