kristen kristen - 2 months ago 16x
Linux Question

How do I use a Samba server location for GOPATH?

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.


Amd Amd

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: