I'm new to Go, have a bit of a problem with reading default file permissions / system mask. Of course I can specify fixed permissions:
f, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY, 0600)
But I would like the program to behave nicely and open a file with user's account set umask
. How can I do that?