加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

GoLang环境搭建

发布时间:2020-12-16 19:18:52 所属栏目:大数据 来源:网络整理
导读:一、下载编译器: 1、国外官方网址:https://golang.org/dl/ 2、国内网址:http://golangtc.com/download 二、IDE编辑器 Source code https://github.com/visualfc/liteide Binary downloads http://sourceforge.net/projects/liteide/files Google group ht

一、下载编译器:

1、国外官方网址:https://golang.org/dl/

2、国内网址:http://golangtc.com/download


二、IDE编辑器

  • Source code
    • https://github.com/visualfc/liteide
  • Binary downloads
    • http://sourceforge.net/projects/liteide/files
  • Google group
    • https://groups.google.com/group/liteide-dev

三、GO入门指南:
1、https://github.com/Unknwon/the-way-to-go_ZH_CN

2、https://tour.go-zh.org/welcome/1

3、https://golang.org/doc/

4、http://studygolang.com/

5、http://www.golangtc.com/

6、http://www.runoob.com/go/go-tutorial.html

7、http://wiki.jikexueyuan.com/project/the-way-to-go/

8、https://github.com/wonderfo/wonderfogo/wiki


四、windows环境安装:

1、点击go1.5.3.windows-386.msi进行安装

2、【next】,接受许可,然后【next】

3、选择安装路径:D:appGo,然后【next】,【Install】

4、【Finish】

5、点击liteidex28.windows-qt4.zip进行解压

6、将目录liteide拷贝到D:app目录下


五、window环境配置

1、将D:appGobin设置到Path环境变量中

2、设置环境变量GOROOT为D:appGo


六、liteide的配置

1、执行liteide.exe

2、菜单【查看】点击【编辑当前环境】

3、去掉GOROOT和GOBIN的注释,填写对应的路径,分别为

上面两行注释掉,放开后,执行install时,会将工程exe文件安装到 d:appgobin下

#GOROOT=D:appGo
#GOBIN=D:appGobin
GOARCH=386
GOOS=windows
CGO_ENABLED=1
 
#GO15VENDOREXPERIMENT=1
 
PATH=c:mingw32bin;%GOROOT%bin;%PATH%
2、保存关闭

3、菜单【查看】点击【管理GOPATH...】

4、点击【添加目录】,添加存放代码的目录:G:my_codeGo

5、点击【OK】


七、编写示例程序

1、菜单【文件】-->【新建】

2、在【Gopath】中选择【G:my_codeGo】,【模板】选择【Go1 Command Project】,名称填写GoLearning

3、点【ok】

4、生成工程和文件后,点选菜单【编译】,【BuildAndRun】

5、ok,在下面输出“Hello World!”,同时在G:my_codeGosrcGoLearning目录下生成GoLearning.exe程序

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读