*声明一个常量 const?MAX?=?4096 *声明一个指定类型的常量 const?LIMIT?int16?=?1024
const?LIMIT2?=?int16(1024) *声明一组常量 const?(
????start??=?0x1?
????resume?=?0x2?
...
分类:
其他好文 时间:
2015-05-10 13:03:18
阅读次数:
118
依赖包: import?"runtime" 代码: buf?:=?make([]byte,?1?<<?20)?
runtime.Stack(buf,?true)
fmt.Printf("\n%s",?buf)...
分类:
其他好文 时间:
2015-05-10 10:01:20
阅读次数:
1017
以ubuntu wiki的安装教程为例:安装gcc工具,因为golang有些功能是使用c写的,所以构建golang的编译是必须的$ sudo apt-get install bison gawk gcc libc6-dev make安装mercurial工具,目的使用hg命令来提取golang的源代...
分类:
系统相关 时间:
2015-05-08 14:45:39
阅读次数:
184
记录golang的获取,因为google访问不了,网上老找不到正确的下载方式,这里记录下先下载golanghttp://golangtc.com/download使用eclipse编辑器,下载eclipsehttp://www.eclipse.org/downloads/下载goclipsehttp...
分类:
其他好文 时间:
2015-05-08 10:49:17
阅读次数:
127
golang passing an array to a function
分类:
其他好文 时间:
2015-05-08 10:46:56
阅读次数:
86
supervisor是一个unix的系统进程管理软件,可以用它来管理apache、nginx等服务,若服务挂了可以让它们自动重启。下面基于centos6.6,描述下具体实现:sudoyuminstallpython-setuptools
sudoeasy_installsupervisor如果没有看到什么报错,那么就安装成功了,可以使用echo_supervi..
分类:
系统相关 时间:
2015-05-07 01:05:28
阅读次数:
220
1.下载并导入数据库驱动包官方不提供实现,先下载第三方的实现,点击这里查看各种各样的实现版本。这里选择了Go-MySQL-Driver这个实现。地址是:https://github.com/go-sql-driver/mysql/。然后按照里面的说明下载驱动包:$ go get github.com...
分类:
数据库 时间:
2015-05-07 00:45:34
阅读次数:
3006
假设要在$GOPATH/pkg/$GOOS_$GOARCH/basepath/ProjectName/目录下开发一个名为xxx的package。(这里basepath指的是github.com/michael-lau)步骤如下:在$GOPATH/pkg/$GOOS_$GOARCH/basepath/...
分类:
其他好文 时间:
2015-05-06 22:55:39
阅读次数:
146
本文章来自于 谷歌官方的翻译: How to Write Go Code?
http://godoc.golangtc.com/doc/code.html介绍这篇文档举例证明了一个简单地 Go package 并且介绍了 go tool,标准的方法来 fetch, build,and install Go package and commands.如果要使用 go tool,那么就必须将代码组织成...
分类:
其他好文 时间:
2015-05-06 13:26:26
阅读次数:
129
请自备足够高的梯子: [https://golang-china.appspot.com/blog/examples](http://golang-china.appspot.com/blog/examples) 欢迎加入Go中文文档翻译项目: [https://github.com/golang-china](https://github.com/...
分类:
其他好文 时间:
2015-05-06 06:58:28
阅读次数:
122