会动的耳朵  

随笔分类 -  golang

golang learning
  • golang url encode
    摘要:import ( fm "fmt" "net/url" rt "runtime")func main() { var urlStr string = "http://baidu.com/index.php/?abc=1_羽毛" l, err := url.ParseQuery(urlStr) fm.Println(l, err) l2, err2 := url.ParseRequestURI(urlStr) fm.Println(l2, err2) l3, err3 := url.Parse(urlStr) fm. 阅读全文
    posted @ 2014-01-17 10:51 会动的耳朵 阅读(16937) 评论(0) 推荐(0)
  • go build 减小生成文件的体积大小
    摘要:减小go生成文件大小 go build -ldflags ”-s -w”go build -ldflags ”-H windowsgui -s -w”没有测试...... 阅读全文
    posted @ 2014-01-08 15:19 会动的耳朵 阅读(400) 评论(0) 推荐(0)
  • Go Install 安装GoMysql
    摘要:下载GoMysql后才发现Makefile中包含的路径有问题,不敢乱改,还是先查查吧好吧,直接cp到goroot/src/pkg即可是不是其他的也该这么安装,邪恶~~~经过实验,还是这个有效参考 :http://www.shenyisyn.org/2013/06/21/golang-3.htmhttps://github.com/go-sql-driver/mysql使用git在goroot/src/pkg/ 执行git clone git://github.com/go-sql-driver/mysql直接可以使用import ( "mysql")demo 1 packa 阅读全文
    posted @ 2013-12-13 17:59 会动的耳朵 阅读(1145) 评论(0) 推荐(0)
  • Golang 与decimal类似的语法
    摘要:1 // blank_identifer 2 package main 3 4 import ( 5 "fmt" 6 //"math" 7 ) 8 9 func main() {10 var a, b int11 var c float3212 //a, b, c = treeValues(10, 11, float32(math.Floor(12.3111)))13 a, b, c = treeValues(10, 11, 312.33332)//这里的g是看文档做的,但是没有理解中文文档里的意思14 fmt.Printf("a=... 阅读全文
    posted @ 2013-11-21 17:50 会动的耳朵 阅读(4561) 评论(1) 推荐(0)
  • Go开发 调试
    摘要:参照: https://github.com/Daniel-ccx/the-way-to-go_ZH_CN/blob/master/eBook/03.3.md 阅读全文
    posted @ 2013-11-14 22:02 会动的耳朵 阅读(151) 评论(0) 推荐(0)
  • Go 环境和开发IDE
    摘要:http://code.google.com/p/golangide/因为开发php一直在Linux下,所以,现在开发go,还是保持了cmd终端开发的习惯。但是有个IDE还是必须的环境:go.googlecode.com 阅读全文
    posted @ 2013-11-14 22:00 会动的耳朵 阅读(212) 评论(0) 推荐(0)
  • go语言 Linux 配置
    摘要:GO安装 http://code.google.com/p/go/downloads 配置参考 https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/02.3.md 1. 配置 环境变量 有的系统是~/.profile ~/.bashrc 记得把go 包安装到/usr/local,可以是其他目录,担心引起其他不必要的 然后重启 cmd终端,再执行go evn: 2. Install Go 我下载的是source包, 参考官方文档:ht... 阅读全文
    posted @ 2013-11-13 17:05 会动的耳朵 阅读(429) 评论(0) 推荐(0)