英文:
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/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论