用过的baidu空间,太难用了,还是cnblogs好用
GZ.Jackey
学无止境,博采众长。
摘要: EDITOR=viexport EDITOR然后crontab -e就不会有这个问题了 阅读全文
posted @ 2015-03-12 21:49 GZ.Jackey 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 原文:Hi there,I just discovered Go and decided to port a little program to Go.The program reads JSON-Data from an URL and process the Data. The Goport w... 阅读全文
posted @ 2015-03-12 10:58 GZ.Jackey 阅读(12175) 评论(0) 推荐(0) 编辑
摘要: 看过好几遍了,觉得挺实用的,记录备忘一下。1.开启很多个goroutine 之后,等待执行完毕type WaitGroupWrapper struct { sync.WaitGroup}func (w *WaitGroupWrapper) Wrap(cb func()) { w.Add(... 阅读全文
posted @ 2015-03-10 14:54 GZ.Jackey 阅读(611) 评论(0) 推荐(0) 编辑
摘要: package mainimport ( "bytes" "compress/zlib" "fmt" "io" "os")//进行zlib压缩func DoZlibCompress(src []byte) []byte { var in bytes.Buffer ... 阅读全文
posted @ 2015-03-09 12:03 GZ.Jackey 阅读(7136) 评论(1) 推荐(0) 编辑
摘要: golang httpserver如果采用 fmt.Fprintf(w, result)来输出json数据时,若json数据包含%号,则会出现问题。输出结果里面会包含(MISSING)字样,造成json格式错误。把输出函数替换为w.Write即可。func Action(w http.Respons... 阅读全文
posted @ 2015-03-02 10:22 GZ.Jackey 阅读(2025) 评论(0) 推荐(0) 编辑
摘要: 背景:golang的http服务,读取文件,提供给client下载时候。出现multiple http.writeHeader calls 错误。func DownloadFile(w http.ResponseWriter, r *http.Request, sequence uint64, us... 阅读全文
posted @ 2015-02-26 10:54 GZ.Jackey 阅读(3258) 评论(1) 推荐(0) 编辑
摘要: 图片去除边框(黑边,白边)package mainimport ( "fmt" "github.com/gographics/imagick/imagick" "io/ioutil" "os" "strconv")func ReadFile(path string) (... 阅读全文
posted @ 2015-02-10 11:29 GZ.Jackey 阅读(2643) 评论(0) 推荐(0) 编辑
摘要: 啥都不说了,居然有文档,有git为啥不提供example?自己看代码,琢磨了一下,原来是要这么用的。这里不得不吐槽一下package的命名,为啥要去io?golang自带系统包名就有io啊,哥哥。从git上线下载包,go get -u github.com/qiniu/api然后,贴代码:packa... 阅读全文
posted @ 2015-02-05 17:21 GZ.Jackey 阅读(1802) 评论(0) 推荐(0) 编辑
摘要: 网上很多版本发送邮件都是用; 号,关键在于,多个邮件分割不能用; 号,需要用,号// send mailfunc SendMail(subject string, message string, from *mail.Address, to []string, smtpConfig SmtpConf... 阅读全文
posted @ 2015-01-22 16:26 GZ.Jackey 阅读(5215) 评论(0) 推荐(0) 编辑
摘要: RabbitMQ一、背景命令行工具:http://www.rabbitmq.com/man/rabbitmqctl.1.man.html介绍入门文章:http://blog.csdn.net/anzhsoft/article/details/19563091内容比较清晰:http://www.dig... 阅读全文
posted @ 2014-12-16 14:51 GZ.Jackey 阅读(4614) 评论(0) 推荐(2) 编辑