In most of the function declarations I've seen in Go, the format is Name, Arguments, Output. Such as the following:
func add(a, b int) int {
return a + b
}
But in this example, the pointer is given in the beginning of the declaration, instead of in the argument section right after the name. My question is: what is the cause is this format? Are pointers written differently when they're arguments?
func (p *Page) save() error {
filename := p.Title + ".txt"
return ioutil.WriteFile(filename, p.Body, 0600)
}