Go语言学习,有两个重要部分,一是安装Go语言包,二是安装开发的编译器。
次篇博客借助(https://www.cnblogs.com/qicun/p/11378354.html)完成的
一、go语言的安装包在网址(https://golang.google.cn/dl/)下载,
下载完成后,直接安装,一直下一步就行,会出更改安装位置的选项,
可以更改,也可以不更改,不更改的话,默认在C:\Go\目录下
安装完成后截图如下:
安装完成后,目录结构如下图所示;
这个目录结构遵循GOPATH规则,GOPATH 及相关的目录命名是 Go语言编译的核心规则
下面对Windows的系统环境变量进行设置
打开电脑,此电脑->属性->高级系统设置->环境变量
在系统变量下,新建一个变量,添加GOPATH属性,此路径是个代码存放路径
在GOPATH下新建三个文件夹
bin:用于存放编译后的生成的可执行文件
pkg:用于存放编译后生成的归档文件
src:用于存放源码文件
在进行Go语言开发的时候,我们的代码总是会保存在$GOPATH/src
目录下。在工程经过go build
、go install
或go get
等指令后,
会将下载的第三方包源代码文件放在$GOPATH/src
目录下, 产生的二进制可执行文件放在 $GOPATH/bin
目录下,生成的中间缓存
文件会被保存在 $GOPATH/pkg
下
如果我们使用版本管理工具(Version Control System,VCS。常用如Git)来管理我们的项目代码时,我们只需要添加
$GOPATH/src
目录的源代码即可。bin
和 pkg
目录的内容无需版本控制。
二、goland安装破解可参考(http://www.imooc.com/article/details/id/288329)
编译器可以使用goland进行开发,下载地址为(http://www.jetbrains.com/go/)
windows下载goland成功后,进行安装
安装过程中,会出来对配置进行勾选,根据自己需求自己选择
安装完成后,进行破解
1、先通过30天的免费试用,创建一个项目,进入到goland里面
2、https://pan.baidu.com/s/112tS3XjAENIHaJ-aSCe0dA ,下载破解文件
3、"Help" -> "Edit Custom VM Options..."在打开的vmoptions编辑窗口末行添加
-javaagent:你goland的安装目录\jetbrains-agent.jar
4、修改完配置文件之后重启GoLand (请仔细检查补丁路径是否正确,如果错误则会出现GoLand打不开的情况)
5、"Help" -> register ,把下面copy到activation code里面去
520E5894E2-eyJsaWNlbnNlSWQiOiI1MjBFNTg5NEUyIiwibGljZW5zZWVOYW1lIjo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