Advertisement
Guest User

Untitled

a guest
May 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.23 KB | None | 0 0
  1. type rect struct {
  2.     width, height float64
  3. }
  4. type circle struct {
  5.     radius float64
  6. }
  7. func (r rect) area() float64 {
  8.     return r.width * r.height
  9. }
  10. func (c circle) area() float64 {
  11.     return math.Pi * c.radius * c.radius
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement