centos7 go yum 安装_vscode+go远程开发

2e9c3172738b134712c5901f68c0472f.png

背景

目前在公司运维开发中逐步使用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配置

  1. 安装vscode-remote-extensionpack

2. 配置ssh server

88b1f28a64792503097e05780e985846.png

3. 安装扩展

58a73fb3d1ef57c17ec6f9633c46cf05.png

好了,现在开始coding

参考:

Git - 凭证存储​git-scm.com Developing on Remote Machines using SSH and Visual Studio Code​code.visualstudio.com
d059fc7414451c8a67106204bd9df4d4.png
李志华:Centos7升级git​zhuanlan.zhihu.com
Remote Development​marketplace.visualstudio.com
da31696c7c18a760aae8777296e57bfe.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值