一、在 Windows 上安装 Go 环境
首先在 Go 官网 下载 Windows 系统下的一键安装包。

然后双击打开该文件,一直点 Next 就行。



注意这里默认是安装到 C 盘,建议不要修改,因为环境变量会自动设置,如果安装到其他盘,那么可能需要手动修改所有环境变量的值。



二、查看环境变量
打开控制面板,点击用户账户:

再点击用户账户:

点击左边的更改我的环境变量:

发现已经有了 GOPATH 环境变量:

三、测试 Go 环境是否安装成功
新建一个 hello_world.go 文件。

输入以下代码:
然后打开 PowerShell,进入该文件所在路径,输入命令:
看到有输出结果 Hello world:

四、安装 GoLand
上网查阅了相关资料,网上推荐使用 GoLand 或者 VS Code 这两款 IDE。这里选择安装 Goland。在官网下载,然后一直点 Next。

这里勾选了 64-bit launcher、Add launchers dir to the PATH、.go 三个。分别是创建桌面快捷方式 64 位、更新 PATH 环境变量、关联 .go 后缀文件。




这里我没选安装其他插件。

然后打开之前那个 hello_world.go 文件,运行,成功输出结果。
