随笔分类 -  golang

摘要:1) Append a slice b to an existing slice a: a = append(a, b...)2) Copy a slice a to a new slice b: b = make([]T, len(a))copy(b, a)3) Delete item at in... 阅读全文
posted @ 2014-07-02 10:30 Gang.Wang 阅读(1673) 评论(0) 推荐(0)
摘要:试试go来一个简单的web server 1 package main 2 3 import ( 4 "fmt" 5 "net/http" 6 ) 7 8 // Default Request Handler 9 func defaultHandler(w http.ResponseWriter, r *http.Request) {10 fmt.Fprintf(w, "<h1>Hello %s!</h1>", r.URL.Path[1:])11 }12 13 func main() {14 http.Hand 阅读全文
posted @ 2013-02-24 21:43 Gang.Wang 阅读(548) 评论(0) 推荐(0)