当前位置:网站首页>Go语言系列:如何搭建Go语言开发环境?
Go语言系列:如何搭建Go语言开发环境?
2022-07-27 12:49:00 【InfoQ】
前言
GoGoGoWindowMac搭建开发环境
Go一、Go下载
Go2Golang中国: https://golang.google.cn/dl/
Go语言官网: https://golang.org/dl/
GoGolangGolang


- 安装包支持的系统
- 安装包支持的的系统版本和
CPU位数
1.18.4表示当前安装包的版本号,中间英文表示系统,amd64表示匹配64位的CPU
- 安装包的文件大小
二、Windows系统安装Go教程
WindowsGo2.1 下载安装包
Windows
2.2 开始安装

Next


C:\Program Files\Go
api:各个版本api变更差异
bin:go源码包编译出来的编译器、格式化工具、文档工具等
doc:英文版的go文档
lib:依赖的一些库文件
misc:其他用途的相关文件,如Android平台的编译等
pkg:windows平台编译好的中间件
src:标准库源码
test:测试用力
2.3 检查Go是否安装成功
cmdgo version
WindowsGo三、Mac系统安装Go教程
MacGo3.1 方式一:通过brew安装
brewbrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brewvpnvpnbrew- 打开手机热点,
mac电脑连接手机热点
- 然后输入
brew官网安装命令,会发现下载速度很快,最终安装成功
brewgoMacGogobrew install go brew install golang3.2 方式二:下载安装包
Mac
Mac
继续安装成功

3.3 检查Go是否安装成功
go versiongo
四、编写第一个Go语言程序
hello world!4.1 开始
helloworld.gopackage main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
Hello World!4.2 执行
gogo rungo run helloworld.go
go buildhelloworldhelloworld.exe


GowindowmacGo后语
边栏推荐
- Map interface
- Talk about one of the important classes of feign components, reactivefeign
- Minimally invasive brain science broke the listing: the company's market value is HK $14.3 billion, and minimally invasive medical is the major shareholder
- 内涵语录
- 18. Text processing tool -grep
- Wfuzz, a test tool that can blur everything that can be blurred
- Preliminary discussion on NetGen and Gmsh mesh generation of any multiple sub models of CAD based on osg+occ
- 最新版泛域名证书申请
- Bank case | ZABBIX cross version upgrade guide, isn't 4.2-6.0 popular?
- Poj2446 chessboard [maximum matching of bipartite graph]
猜你喜欢

From the perspective of it, the CIO of B2B industry talks about how to change from "cost center" to "growth center"?

Map interface

Can you tell me the difference between lateinit and lazy in kotlin?

@Simple understanding and use of conditionalonproperty

Interview site: three kinds of questions

PAT乙级 1109 擅长C(详解)

Li Kou 1480. Dynamic sum of one-dimensional array 383. Ransom letter 412. Fizz buzz

ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!

Article reproduction: srcnn

Qt优秀开源项目之十三:QScintilla
随机推荐
Gartner 权威预测未来4年网络安全的8大发展趋势
A survey of video game addictive behavior research
Aike AI frontier promotion (7.27)
flinksql从Oracle同步数据到Doris,一共50几个字段,Oracle表中3000多万条
马斯克被曝绿了谷歌创始人:导致挚友二婚破裂,曾下跪求原谅
v-show
MTK6765编译环境搭建
Feign's dynamic proxy
AMD Adrenalin 22.7.1 驱动更新:OpenGL 性能翻倍,支持微软 Win11 22H2 系统
Multi activity disaster recovery construction after 713 failure of station B | takintalks share
@Simple understanding and use of conditionalonproperty
Initializing database error after reinstalling MySQL
Four characteristics of transactions (acid):
Sff1004-mhchxm diode sff1004
Method of changing thread state
Have you understood these 30 questions of enabling financial risk control plus points
Gan: generate adversarial networks
POJ1273 Drainage Ditches【最大流】【SAP】
Poj2594 treasure exploration [bipartite graph minimum path coverage] [Floyd]
Wfuzz, a test tool that can blur everything that can be blurred