当前位置:网站首页>最新Windows下Go语言开发环境搭建+GoLand配置
最新Windows下Go语言开发环境搭建+GoLand配置
2022-06-24 08:08:00 【BigChen_up】
一、下载Go语言开发包
大家可以在Go语言官网(https://golang.google.cn/dl/)下载 Windows 系统下的Go语言开发包,如下图所示。
这里我们下载的是 64 位的开发包,如果电脑是 32 位系统的话,则需要下载 32 位的开发包,在上图所示页面中向下滚动即可找到 32 位开发包的下载地址,如下图所示。
注意:下载 Windows 版本的Go语言开发包时尽量选择 MSI 格式,因为它可以直接安装到系统,不需要额外的操作。
二、安装Go语言开发包
双击我们下载好的Go语言开发包即可启动安装程序,如下图所示,这是Go语言的用户许可协议,无需管它,直接勾选“I accept …”然后点击“Next”即可。

在 Windows 系统下Go语言开发包会默认安装到 C 盘的 Go 目录下,推荐在这个目录下安装,使用起来较为方便。当然,你也可以选择其他的安装目录,确认无误后点击“Next”,如下图所示:
Go语言开发包的安装没有其他需要设置的选项,点击“Install”即可开始安装,如下图所示:
等待程序完成安装,然后点击“Finish”退出安装程序。

安装完成后,在我们所设置的安装目录下将生成一些目录和文件,如下图所示:
三、设置环境变量
开发包安装完成后,我们还需要配置一下GOPATH 环境变量,之后才可以使用Go语言进行开发。GOPATH 是一个路径,用来存放开发中需要用到的代码包。
在桌面或者资源管理器右键“此电脑”(或者“我的电脑”)→“属性”→“高级系统设置”→“环境变量”,如下图所示。
在弹出的菜单里找到 GOPATH 对应的选项点击编辑之后就可以修改了,没有的话可以选择新建,并将变量名填写为 GOPATH,变量值设置为任意目录均可(尽量选择空目录),例如 D:\Go。

四、开发工具智能设置环境变量
本教程使用的是GoLand开发工具,Goland下载如下:
Goland 下载和安装
大家可以从 Goland 的官网下载对应版本的 Goland 的安装包
官网下载地址:https://www.jetbrains.com/go/download/other.html
- 配置GOROOT 打开GoLand开发工具点击:File/Settings/GOROOT 如图:

- 配置GOPATH。打开GoLand开发工具点击:File/Settings/GOPATH 如图:

配置完成就可以撸代码了,在D:\goProject 文件夹下新建一个test.go文件如下:
package main
import "fmt"
func main() {
fmt.Println("hello world")
}

边栏推荐
- Linux MySQL installation
- PM2 deploy nuxt3 JS project
- threejs辉光通道01(UnrealBloomPass && layers)
- When programmers are asked if they can repair computers... | daily anecdotes
- [noi Simulation Competition] geiguo and time chicken (structure)
- [bug] @jsonformat has a problem that the date is less than one day when it is used
- Niuke network realizes simple calculator function
- Go 语言项目开发实战目录
- The border problem after the focus of input
- Every (), map (), forearch () methods. There are objects in the array
猜你喜欢

NETRCA: AN EFFECTIVE NETWORK FAULT CAUSE LOCALIZATION之论文阅读

Zero foundation self-study SQL course | related sub query
![[use picgo+ Tencent cloud object to store cos as a map bed]](/img/14/d650960cc77385504ea5e2e138bd46.jpg)
[use picgo+ Tencent cloud object to store cos as a map bed]

【gdb调试工具】| 如何在多线程、多进程以及正在运行的程序下调试

Easyexcel single sheet and multi sheet writing

Time series data augmentation for deep learning: paper reading of a survey

学习太极创客 — ESP8226 (十三)OTA

【Redis实现秒杀业务①】秒杀流程概述|基本业务实现

Data middle office: detailed explanation of technical architecture of data middle office

Numpy NP in numpy c_ And np r_ Explain in detail
随机推荐
Pytoch read data set (two modes: typical data set and user-defined data set)
从618看京东即时零售的野心
MySQL - SQL statement
The list of open source summer winners has been publicized, and the field of basic software has become a hot application this year
Squid proxy application
深入解析 Apache BookKeeper 系列:第三篇——读取原理
Leetcode -- wrong set
[e325: attention] VIM editing error
Depens:*** but it is not going to be installed
Dynamic saving and recovery of FPU context under risc-v architecture
Some common pitfalls in getting started with jupyter:
牛客网 实现简单计算器功能
leetcode--字符串
目标检测系列——Fast R-CNN
How to configure environment variables and distinguish environment packaging for multi terminal project of uniapp development
[ES6 breakthrough] promise is comparable to native custom encapsulation (10000 words)
leetcode--链表
Data midrange: analysis of full stack technical architecture of data midrange, with industry solutions
Scheme of alcohol concentration tester based on single chip microcomputer
Data middle office: middle office practice and summary