I'm trying to create directories with certain permissions using os.Mkdir but I cannot make it work, for some reason.
My test program is:
package main
import (
"log"
"os"
)
func main() {
err := os.Mkdir("testdir", 0775)
if err != nil {
log.Print(err)
}
}
However, the created directory has the default 0755 permissions:
drwxr-xr-x 2 user user 4096 Jan 10 10:14 testdir
A chmod from the shell works just fine, so I'm not sure why the Go program is not working.