环境搭建
2018-05-02 本文已影响0人
拉风的老衲
1.Go 语言环境安装
1.window
安装包下载地址为:https://golang.org/dl/。
如果打不开可以使用这个地址:https://golang.google.cn/dl/。

安装测试
创建工作目录 F:>go。 #看心情哈哈
文件名: test.go,代码如下:

[图片上传中...(image.png-6ef95e-1525244833912-0)]
使用 go 命令执行以上代码输出结果如下:
F:\go>go run test.go

2 linux
一、下载和解压go环境包
>cd /usr/local/src/
>wget -c http://golangtc.com/static/go/go1.4beta1.linux-amd64.tar.gz
>tar zxvf go1.4beta1.linux-amd64.tar.gz -C /usr/local

然后将/usr/local/go/bin添加到PATH环境变量中,执行
export PATH=$PATH:/usr/local/go/bin
官方文档 https://go-zh.org/doc/
具体详见 http://www.runoob.com/go/go-tutorial.html