I understand what permissions mean for files and dirs stored in filesystem. But why do I need to set permissions when calling os.OpenFile? Does it update file permission on filesystem if opened successfully? If not - what difference does it make to open same file with 0000 or 0777?
https://golang.org/src/os/file.go?s=8454:8520#L272
func OpenFile(name string, flag int, perm FileMode) (*File, error)
...
f, err := os.OpenFile("access.log", os.O_APPEND, 0644)