Skip to content

Instantly share code, notes, and snippets.

@prakashpandey
Created January 13, 2019 18:40
Show Gist options
  • Save prakashpandey/ce8f7ae33b0feb21cfafd3331a9e25d3 to your computer and use it in GitHub Desktop.
Save prakashpandey/ce8f7ae33b0feb21cfafd3331a9e25d3 to your computer and use it in GitHub Desktop.
// 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