mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
* gi: rename gi_c into _gi_c * gi: rename test into _test * gi: fix README syntax
16 lines
174 B
Go
16 lines
174 B
Go
package main
|
|
|
|
type Coord struct {
|
|
x, y int
|
|
}
|
|
|
|
func (c Coord) dist() int { return c.x*c.x + c.y*c.y }
|
|
|
|
func main() {
|
|
o := Coord{3, 4}
|
|
println(o.dist())
|
|
}
|
|
|
|
// Output:
|
|
// 25
|