go语言学习笔记

一.官网 下载

    英文官网 http://golang.org/

    中文官网 http://zh.golanger.com/ 

 

二.zip安装配置环境变量

系统变量名:
GOROOT
值:C:\go\bin
Go的安装位置
C:\go
系统变量名:
Path
追加值:
;%GOROOT%\bin

三.是否正确安装

go version

四.编译,执行

1.编译

go build -o C:\test.exe C:\test.go

或者

go build C:\test.go

2.

执行,在命令提示符中执行命令:

test.exe

五.注意(window环境)

     用go get去安装第三方包出错:exec: "hg": executable file not found in %PATH%

需要安装Mercurial的hg 下载地址 http://mercurial.selenic.com/release/windows/Mercurial-2.7-x64.exe 安装成功后就可以使用  go get 命令了

   如果出现 go build runtime: windows/386 must be bootstrapped using make.bashhou 错误

   去掉

GOARCH
GOOS

两个环境变量

 

 

posted @ 2013-12-03 23:27  choukin  阅读(218)  评论(0编辑  收藏  举报