shad-go/lectures/02-interfaces/geometry/point_test.go

14 lines
217 B
Go
Raw Normal View History

2020-02-27 14:43:12 +00:00
package geometry
import (
"fmt"
"testing"
)
func TestPoint(t *testing.T) {
p := Point{1, 2}
q := Point{4, 6}
fmt.Println(Distance(p, q)) // "5", function call
fmt.Println(p.Distance(q)) // "5", method call
}