背景
目前在公司运维开发中逐步使用golang作为首选语言,同时使用vscode+插件作为开发环境,最近的一个项目就是用beego开发的,目前使用的数据量和goroutine都比较大了,办公机已经开始变得比较卡,所以今天研究一下vscode的remote ssh+golang环境设置。
Centos7 Server 配置
安装go环境
# wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
升级git2.x,vscode推荐用git 2.x
# yum remove git -y
配置用户环境
# useradd xxx
配置git https免密
echo
下面配置git让其和windows git提示符一致,如果不需要可以跳过
echo
部署代码和工具
cd go/src/
$ git clone https://gitlab.domain/xxx/projectname
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh
办公机配置
配置ssh免密登录
# 在办公机上运行
ssh-copy-id xxx@centos7_server_ip
vscode配置
- 安装vscode-remote-extensionpack
2. 配置ssh server
3. 安装扩展
好了,现在开始coding
参考:
Git - 凭证存储git-scm.com Developing on Remote Machines using SSH and Visual Studio Codecode.visualstudio.com