Methods and pointer indirection (2)
The same flexibility works in reverse for value receivers.
A function taking a value argument requires exactly a value — pass a pointer and it won’t compile:
var v Vertex
fmt.Println(AbsFunc(v)) // OK
fmt.Println(AbsFunc(&v)) // Compile error!
But a method with a value receiver accepts both:
var v Vertex
fmt.Println(v.Abs()) // OK
p := &v
fmt.Println(p.Abs()) // OK
When you call p.Abs() on a pointer, Go automatically dereferences it: (*p).Abs(). Clean and consistent.