given
type Rectangle struct {
h, w int
}
func (rec *Rectangle) area() int {
return rec.w * rec.h
}
Can you define a Square
struct using Rectangle, so I can make use of area method? It is absolutely fine if it is not possible. I won't judge the language or cry or get upset. I am just learning the golang.