I'm following this simple go web app tutorial, and came across this method:
func (p *Page) save() error {
filename := p.Title + ".txt"
return ioutil.WriteFile(filename, p.Body, 0600)
}
About the value 0600
it says:
The octal integer literal 0600, passed as the third parameter to WriteFile, indicates that the file should be created with read-write permissions for the current user only. (See the Unix man page open(2) for details.)
Are these values stored anywhere, maybe in the os
or ioutil
packages as some sort of constant/enum type value with meaningful names? Or are we expected to remember what each value means (or implement our own named constants)?