如何让 Atom.io 上的 go-plus 插件意识到我正在服务器上进行开发?

huangapple go评论83阅读模式
英文:

How do I make go-plus with Atom.io aware that I'm developing on a server?

问题

我正在使用Atom.io作为我的主要Go开发编辑器,使用go-plus插件。它在本地工作得很好,语法检查器可以找到代码中的任何问题。

但是,如果我使用Transmit通过SFTP连接到我的服务器,并使用Atom编辑文件,如果我尝试import一个我在服务器上有的包,它会认为该包不存在(因为它在本地查找?),并且语法检查器会显示一个错误。

如何让它意识到我在服务器上,并在服务器上查找包等内容,而不是在本地查找?

英文:

I'm using Atom.io as my primary editor for Go development with the go-plus plugin.
It works great locally and the linter finds any issues in the code.

But if I use something like Transmit to SFTP into my server and edit a file with Atom, if I try to import a package I have on my server, it will think it's not present (because it's looking locally?) and the linter will put up an error.

How do I make it aware that I'm on a server and to look on the server for packages and such, not locally?

答案1

得分: 1

如果你在GOPATH之外使用go install命令,你会看到以下错误信息:

go install: no install location for directory outside GOPATH

我找到的解决方法是将GOPATH设置为网络位置。然后在GOPATH文件夹下克隆其他包,并正常设置导入。

使用mount命令挂载SMB共享:

mount –t smbfs 192.168.0.1:/share1 /mnt –o username=UserName,workgroup=test

参考这个链接了解如何将其挂载到本地驱动器:https://stackoverflow.com/questions/38679294/how-do-i-use-a-samba-server-location-for-gopath/38680558#38680558

参考资料:
http://www.linuxnix.com/8-ways-to-mount-smbfs-samba-file-system-in-linux/

英文:

If you use go install outside GOPATH you will see:

go install: no install location for directory outside GOPATH  

so the workaround I found for this is to
set GOPATH to network location.
and clone other packages under your GOPATH folder and set imports normally.

Mounting SMB share by using mount command:

mount –t smbfs 192.168.0.1:/share1 /mnt –o username=UserName,workgroup=test 

See this for how to mount it to a local drive: https://stackoverflow.com/questions/38679294/how-do-i-use-a-samba-server-location-for-gopath/38680558#38680558

ref:
http://www.linuxnix.com/8-ways-to-mount-smbfs-samba-file-system-in-linux/

huangapple
  • 本文由 发表于 2016年4月26日 05:41:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/36851595.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定