随笔分类 -  golang

摘要:http://tonybai.com/2015/08/05/godep-support-go15-vendor/ 阅读全文

posted @ 2015-10-15 09:46 不忘初衷,方能致远 阅读(145) 评论(0) 推荐(0)

摘要:package mainimport "github.com/go-martini/martini"func main() { m := martini.Classic() m.Get("/", func() string { return "Hello world!" }) m.Ru... 阅读全文

posted @ 2015-09-21 15:45 不忘初衷,方能致远 阅读(464) 评论(0) 推荐(0)

摘要:package mainimport ( "io" "net/http" "log")// hello world, the web serverfunc HelloServer(w http.ResponseWriter, req *http.Request) { io.W... 阅读全文

posted @ 2015-09-21 14:51 不忘初衷,方能致远 阅读(631) 评论(0) 推荐(0)

摘要:package mainimport ( "fmt" "reflect")func main() { x := "hello world" p := reflect.TypeOf(x) v := reflect.ValueOf(x... 阅读全文

posted @ 2015-09-20 01:40 不忘初衷,方能致远 阅读(430) 评论(0) 推荐(0)

摘要:将[]T切片转换为[]byte类似C语言中将其他类型的数组转换为char数组:func ByteSlice(slice interface{}) (data []byte) { sv := reflect.ValueOf(slice) if sv.Kind() != reflect.Sl... 阅读全文

posted @ 2015-09-14 20:35 不忘初衷,方能致远 阅读(938) 评论(0) 推荐(0)

摘要:无法直接从google go get下载。从github或者百度云上下载 go.tools.tar.gz到GOPATH目录下,mkdir -psrc/code.google.com/p把go.tools.tar.gz 解压到上述目录。运行go install code.google.com/p/go... 阅读全文

posted @ 2014-11-28 16:40 不忘初衷,方能致远 阅读(324) 评论(0) 推荐(0)

摘要:go 下载http://www.golangtc.com/downloadcode.google.com/p/winsvc fork download: https://github.com/conformal/winsvchttp://go-lang.cat-v.org/doc/trans/cn/... 阅读全文

posted @ 2014-11-21 11:01 不忘初衷,方能致远 阅读(405) 评论(0) 推荐(0)

导航