Created
January 13, 2019 18:40
-
-
Save prakashpandey/ce8f7ae33b0feb21cfafd3331a9e25d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implement Geometry interface | |
func (r Rectangle) area() float32 { | |
return r.length * r.breadth | |
} | |
// Implement Geometry interface | |
func (r Rectangle) parameter() float32 { | |
return 2 * (r.length + r.breadth) | |
} | |
// Implement Geometry interface | |
func (r Rectangle) numOfSides() int { | |
return 4 | |
} | |
// Implement color interface | |
func (r Rectangle) getColor() string { | |
return r.color | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment