当前位置:网站首页>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
无特殊需求下一步安装即可
边栏推荐
- Interview: how does the list duplicate according to the attributes of the object?
- 数组、、、
- beego跨域问题解决方案-亲试成功
- Today in history: the first e-book came out; The inventor of magnetic stripe card was born; The pioneer of handheld computer was born
- ModuleNotFoundError: No module named ‘scrapy‘ 终极解决方式
- 微信核酸检测预约小程序系统毕业设计毕设(8)毕业设计论文模板
- Qt实现json解析
- How to write high-quality code?
- @Serializedname annotation use
- iframe
猜你喜欢
[paper reading] ckan: collaborative knowledge aware autonomous network for adviser systems
5G NR系统架构
What is the origin of the domain knowledge network that drives the new idea of manufacturing industry upgrading?
Window下线程与线程同步总结
非技術部門,如何參與 DevOps?
微信核酸检测预约小程序系统毕业设计毕设(8)毕业设计论文模板
Universal double button or single button pop-up
WorkManager學習一
How did automated specification inspection software develop?
Ad20 make logo
随机推荐
The horizontally scrolling recycleview displays five and a half on one screen, lower than the average distribution of five
SLAM 01.人类识别环境&路径的模型建立
《天天数学》连载58:二月二十七日
Learning II of workmanager
Comparative learning in the period of "arms race"
SAP ui5 objectpagelayout control usage sharing
到底谁才是“良心”国产品牌?
Implementation of wechat applet bottom loading and pull-down refresh
ModuleNotFoundError: No module named ‘scrapy‘ 终极解决方式
变量///
How to write high-quality code?
Glide Mastery
括号匹配问题(STL)
GO项目实战 — Gorm格式化时间字段
【黑马早报】罗永浩回应调侃东方甄选;董卿丈夫密春雷被执行超7亿;吉利正式收购魅族;华为发布问界M7;豆瓣为周杰伦专辑提前开分道歉...
脚手架开发进阶
5G NR系统架构
手机厂商“互卷”之年:“机海战术”失灵,“慢节奏”打法崛起
Taro进阶
beego跨域问题解决方案-亲试成功