当前位置:网站首页>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后语
边栏推荐
- How can the top 500 enterprises improve their R & D efficiency? Let's see what industry experts say!
- Adhesive positioning
- multi-table query
- Flinksql synchronizes data from Oracle to Doris, with a total of more than 50 fields and more than 30 million entries in Oracle tables
- 固定定位
- JS single thread understanding notes - Original
- Absolute positioning
- Perfect guide | how to use ODBC for agent free Oracle database monitoring?
- pg同步多张数据表至mysql 有办法简化配置吗?
- @Simple use of conditional
猜你喜欢

Seata 在蚂蚁国际银行业务的落地实践

Build mtk6765 compilation environment

Baoli food listed on Shanghai Stock Exchange: annual revenue of 1.578 billion, market value of 5.8 billion

赋能金融风控加分项的这30个问题,您都搞懂了吗

Initializing database error after reinstalling MySQL

Optimization Practice of Flink OLAP job scheduling and query execution based on ByteDance

Interview site: three kinds of questions

文章复现:SRCNN

PAT乙级 1109 擅长C(详解)

实现新增加硬盘的磁盘分区和文件系统挂载
随机推荐
内涵语录
接口测试实战教程01:接口测试环境搭建
Gartner 权威预测未来4年网络安全的8大发展趋势
相对定位
From the perspective of it, the CIO of B2B industry talks about how to change from "cost center" to "growth center"?
延迟队列DelayQueue性能测试
Poj1548 robots [bipartite graph minimum path coverage]
C语言犄角旮旯的知识之数组与函数
Is it easy to find a job after programmer training and learning
Bank case | ZABBIX cross version upgrade guide, isn't 4.2-6.0 popular?
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
feign的动态代理
初探基于OSG+OCC的CAD之任意多个子模型进行netgen以及gmsh网格划分
Adhesive positioning
POJ1548 Robots【二分图最小路径覆盖】
592. Fraction addition and subtraction: introduction to expression calculation
数据库HTAP能力强弱怎么看
Interview site: three kinds of questions
QT excellent open source project 13: qscintilla
Forward pre check and reverse pre check