MCPcopy Create free account
hub / github.com/Go-Learning-Land/Go-Learning-Archive / main

Function main

GolangBasics/GoByExample/019Methods.go:17–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17func main() {
18 r := rect{width: 10, height: 5}
19
20 fmt.Println("area: ", r.area())
21 fmt.Println("perim:", r.perim())
22
23 rp := &r
24 fmt.Println("area: ", rp.area()) // same as (&r).area()
25 fmt.Println("perim:", rp.perim()) // same as (&r).perim()
26
27}

Callers

nothing calls this directly

Calls 5

areaMethod · 0.95
perimMethod · 0.95
PrintlnMethod · 0.80
areaMethod · 0.65
perimMethod · 0.65

Tested by

no test coverage detected