To implement an interface in Go, we just need to implement all the methods in the interface. Here we implement `geometry` on `rect`s.
()
| 27 | // implement all the methods in the interface. Here we |
| 28 | // implement `geometry` on `rect`s. |
| 29 | func (r rect) area() float64 { |
| 30 | return r.width * r.height |
| 31 | } |
| 32 | func (r rect) perim() float64 { |
| 33 | return 2*r.width + 2*r.height |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected