当前位置:网站首页>Go语言-1-开发环境配置
Go语言-1-开发环境配置
2022-07-05 10:23:00 【hahyyy】
目录
Go安装
Go有多种安装方式,比如Go源码安装、Go标准包安装、第三方工具(yum、apt-get等)安装
两个环境变量:
- GOROOT:GOROOT就是Go的安装路径
- GOPATH:GOPATH是作为编译后二进制的存放目的地和import包时的搜索路径(其实也是工作目录)
Linux平台安装Go
使用Linux,可以用如下方式快速安装

设置环境变量
在~/.bashrc中添加GOPATH变量
vim ~/.bashrc

添加完后 --> source ~/.bashrc
检查

Mac平台安装Go

Windows平台安装Go
下载
下载路径:https://golang.google.cn/dl/go1.18.3.windows-amd64.msi
安装msi文件
将安装路径添加到环境变量
如:go安装到 C:\Program Files\Go 目录,则添加环境变量GOPATH: C:\Program Files\Go\
并将 %GOPATH%\bin 添加到PATH
检查
IDE安装
Vim是Linux下开发的最基本工具,可以配置一个Vim IDE。我们可以使用开源的安装工具,这里直接用该工具实现一键配置。
下载Vim配置工具
$ git clone https://github.com/lexkong/lexVim
进入lexVim目录,下载go ide需要的二进制文件
$ cd lexVim
$ git clone https://github.com/lexkong/vim-go-ide-bin
启动安装脚本
$ ./start_vim.sh
Windows平台GoLand安装
下载地址:https://www.jetbrains.com/go/
可试用30天或自行破解
测试工具安装
Linux平台Curl工具
安装curl
使用方法
https://www.ruanyifeng.com/blog/2011/09/curl.html
https://www.ruanyifeng.com/blog/2019/09/curl-reference.html
Windows平台 APIPOST安装
下载地址:https://www.apipost.cn/?utm_source=10039&bd_vid=10756414022759907776
无特殊需求下一步安装即可
边栏推荐
猜你喜欢

Learning II of workmanager

How to write high-quality code?

Workmanager Learning one

“军备竞赛”时期的对比学习

mongoDB副本集

2022年化工自动化控制仪表考试试题及在线模拟考试

2022年流动式起重机司机考试题库及模拟考试

Learning note 4 -- Key Technologies of high-precision map (Part 2)

A large number of virtual anchors in station B were collectively forced to refund: revenue evaporated, but they still owe station B; Jobs was posthumously awarded the U.S. presidential medal of freedo

微信核酸检测预约小程序系统毕业设计毕设(6)开题答辩PPT
随机推荐
字符串、、
What is the origin of the domain knowledge network that drives the new idea of manufacturing industry upgrading?
Comparative learning in the period of "arms race"
伪类元素--before和after
Golang应用专题 - channel
[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems
九度 1480:最大上升子序列和(动态规划思想求最值)
分享.NET 轻量级的ORM
DDOS攻击原理,被ddos攻击的现象
【js学习笔记五十四】BFC方式
[vite] 1371 - develop vite plug-ins by hand
Web Components
2022年危险化学品生产单位安全生产管理人员特种作业证考试题库模拟考试平台操作
LDAP概述
正则表达式
《通信软件开发与应用》课程结业报告
学习笔记4--高精度地图关键技术(下)
微信核酸检测预约小程序系统毕业设计毕设(7)中期检查报告
Secteur non technique, comment participer à devops?
一个可以兼容各种数据库事务的使用范例