Why must we declare a variable name when adding a method to a struct in Golang?

Viewed 532

Let's say I have a struct

type Rectangle struct {
    length, width int
}

and I want to add a method to it:

func (r Rectangle) Area() int {
    return r.length * r.width
}

Why must I give it a variable name here r?

2 Answers
Related