2016-07-30 23:04
浏览 41


I am trying to set my GOPATH to a shared network folder. When I enter

export GOPATH=smb://path/to/shared/folder

I get:

go: GOPATH entry is relative; must be absolute path: "smb".
Run 'go help gopath' for usage.

I've also tried to prefix the path w/ "/" but then it tries to make a folder in root.


图片转代码服务由CSDN问答提供 功能建议

我正在尝试将GOPATH设置为共享网络文件夹。 输入

  export GOPATH = smb:// path / to / shared / folder 

  go:GOPATH条目是相对的; 必须为绝对路径:“ smb”。
运行'go help gopath'以供使用。

我还尝试为路径加上“ /”作为前缀


  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dsuxcxqep31023992 2016-07-31 03:43

    there is only one solution for this:
    Map ( mount) a Samba server file path as a Local Disk Drive ( local path), then set GOPATH to this local path:

    Mounting SMB share on local folder by using smbmount command (smbmount is deprecated):

    smbmount //ipadd/sharename /mountpoint –o  username=userid,workgroup=workgroupname

    Example :

    smbmount // /mnt –o username=steev,workgroup=test

    Mounting SMB share by using mount command

    mount –t smbfs ipadd:/sharename /mountpoint –o username=userid,workgroup=workgroupname


    mount –t smbfs //ipadd/sharename /mountpoint –o username=userid,workgroup=workgroupname

    Example :

    mount –t smbfs /mnt –o username=surendra,workgroup=test

    and for Windows:

    打赏 评论
  • doutinghou6980 2016-07-31 03:36

    You need to mount the Samba share to a folder on your machine:

    $ mkdir /mnt/samba
    $ smbmount smb://path/to/share /mnt/samba

    Of course you may need to use switches on the smbmount command to provide username, password, workgroup, etc., depending on the configuration of the Samba share you're trying to access. Once you've mounted the share you can then do

    $ export GOPATH=/mnt/samba

    And as far as Go is concerned the files in the Samba share will be located on your local machine.

    打赏 评论

相关推荐 更多相似问题