Go语言IDE远程连接Linux服务器

时间:2023-03-10 02:57:49
Go语言IDE远程连接Linux服务器

我因为在自己的云服务器上面进行Go语言开发,IDE必不可少,为了减少对于服务器的压力决定使用golang远程连接进行开发:

首先准备goland

https://www.jetbrains.com/go/

官网下载,然后大家都懂的哈。

完成后基本的安装配置完进行后续步骤:

打开File=》setting=》Plugins=》Install JetBrains plugins

搜索Remote Hosts Access,点击Install

Go语言IDE远程连接Linux服务器

配置

Settings=》build, execution, deployment=》deployment

Go语言IDE远程连接Linux服务器

Add Server:命名和选择SFTP

进行配置:

Connection里面的设置:

SFTP host:填写服务器ip

Root path:服务器的go项目存放路径,例如我配置的是/home/Go/go-project

User name:服务器账号

Password:服务器密码

Go语言IDE远程连接Linux服务器

Mappings里面的设置:

Local path:本地电脑的项目路径

Deployment path on server:具体某个项目的路径

Go语言IDE远程连接Linux服务器

配置完成!

把服务器项目下载到本地的项目文件中(2种情况:项目未下载过本地或已下载过本地):

1、之前未把项目下载到本地:

(1)、Tools=》Deployment=》Browse Remote Host

Go语言IDE远程连接Linux服务器

(2)弹出Remote Host之后,右键选择项目=》Download from here
Go语言IDE远程连接Linux服务器