I use following command to check if a directory is mounted.
res := exec.Command("mount", "|", "grep", toDir, ">", "/dev/null").Run()
But it returns exit status 1
no matter if a directory is mounted or not.
mount | grep /path/to/dir > /dev/null
On command line works fine.
How can I get the information?