by gtrubetskoy · 10y ago · 0 comments
The parameter is actually quite explicit (unlike some other languages).
It would probably help your write up to talk about the difference between (using your example):
func (r Rectangle) Area() float64 {
and func Area(r Rectangle) float64 {
As well as (this is a common rookie mistake): func (r Rectangle) SetWidth(w float64) {
r.Width = w // does nothing
and func (r *Rectangle) SetWidth(w float64) {
r.Width = w