Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type rect struct {
- width, height float64
- }
- type circle struct {
- radius float64
- }
- func (r rect) area() float64 {
- return r.width * r.height
- }
- func (c circle) area() float64 {
- return math.Pi * c.radius * c.radius
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement