shad-go/lectures/02-interfaces/geometry/point_test.go
2020-02-27 17:43:26 +03:00

13 lines
217 B
Go

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
}