当前位置:网站首页>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后语
边栏推荐
- 图标字体
- Pyside6/pyqt development experience summary (2) - set shortcut keys
- Feign的两个调用处理器
- 程序员培训学习后好找工作吗
- clear
- Four characteristics of transactions (acid):
- What should I do if I can't see any tiles on SAP Fiori launchpad?
- 视频游戏沉迷行为研究综述
- Bank case | ZABBIX cross version upgrade guide, isn't 4.2-6.0 popular?
- Article reproduction: srcnn
猜你喜欢

Build mtk6765 compilation environment

Realize the disk partition and file system mount of the newly added hard disk

How to debug JNI program

马斯克被曝绿了谷歌创始人:导致挚友二婚破裂,曾下跪求原谅

v-on基础指令

Pat class B 1109 good at C (detailed)

Isolation level

Initializing database error after reinstalling MySQL

Is it easy to find a job after programmer training and learning

18. Text processing tool -grep
随机推荐
Feign's dynamic proxy
W3School导航栏练习
JNI程序如何进行参数传递
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
Final solution for high collapse (no side effects)
Feign's overall process
数据库HTAP能力强弱怎么看
银行案例|Zabbix跨版本升级指南,4.2-6.0不香吗?
Relative positioning
18. Text processing tool -grep
xshell7可以登录mysql虚拟机不能登陆mysql
力扣 1480. 一维数组的动态和 383. 赎金信412. Fizz Buzz
Gartner authority predicts eight development trends of network security in the next four years
能说一说 Kotlin 中 lateinit 和 lazy 的区别吗?
湖仓一体电商项目背景与架构介绍及基础环境准备
初探基于OSG+OCC的CAD之任意多个子模型进行netgen以及gmsh网格划分
Forward pre check and reverse pre check
[node+ts] build node+typescript project
clear
52:第五章:开发admin管理服务:5:开发【分页查询admin账号列表,接口】;(Swagger的@ApiParam(),对方法参数进行注释;PageHelper分页插件;拦截器拦截检查登录状态)