It works fine. In this case my nfs server is a IP address like 10.1.1.1
The other day I changed. my nfs server to Cloud file server which is a URL like xxx.xxx.amazon.com
then I found my program is not working. When I try to mount the nfs I just got a error which is 「invalid parameter」.
So I wonder what’s wrong with my Code.
In addition. I tried mount the nfs file system by shell it works fine.
Thank you
For most types all the mount program has to do is issue a simple mount(2) system call, and no detailed knowledge of the filesystem type is required. For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) ad hoc code is necessary. The nfs, nfs4, cifs, smbfs, and ncpfs filesystems have a separate mount program. In order to make it possible to treat all types in a uniform way, mount will execute the program /sbin/mount.TYPE (if that exists) when called with type TYPE. Since various versions of the smbmount program have different calling conventions, /sbin/mount.smbfs may have to be a shell script that sets up the desired call.
So the mount command might do some extra work for the syscall.Mount…
As a workaround, you can call the shell from Go using os/exec.