![Ubuntu下golang环境搭建 Ubuntu下golang环境搭建](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
参考官方文档:https://golang.org/doc/editors.html
1、安装golang
apt install golang
2、配置GOPATH
mkdir ~/gopath
vim ~/.zshrc,添加一行:
export GOPATH="/home/robin/gopath"
3、安装vim-go
先安装vim插件管理工具:https://github.com/VundleVim/Vundle.vim
安装vim-go:https://github.com/fatih/vim-go