func stringToInt(s string) int {
i, err := strconv.Atoi(s)
check(err)
return i
}
os.FileMode(stringToInt("0777"))
when no conversion to int is required (leading zero is not removed) by setting the permission directly:
os.FileMode(0777)
the file permissions are correct
Current outcome
777
777
-r----x--x
753
753
--wxrw---x
500
500
-rwxrw-r--
Expected outcome
777
-rwxrwxrwx
753
-r-xr-x-wx
500
-r-x------