Receivers
type Vertex struct { X, Y float64 }
func (v Vertex) Abs() float64 { return math.Sqrt(v.X * v.X + v.Y * v.Y) }
v := Vertex{1, 2} v.Abs()
See: Methods
Comments
type Vertex struct { X, Y float64 }
func (v Vertex) Abs() float64 { return math.Sqrt(v.X * v.X + v.Y * v.Y) }
v := Vertex{1, 2} v.Abs()
See: Methods