Skip to content

Instantly share code, notes, and snippets.

@kadukf-outreach
Created September 14, 2020 21:41
Show Gist options
  • Save kadukf-outreach/0e819c86ac6e38e10473ebe0f4c5a45e to your computer and use it in GitHub Desktop.
Save kadukf-outreach/0e819c86ac6e38e10473ebe0f4c5a45e to your computer and use it in GitHub Desktop.
type Shape interface {
Area() int
}
type Square struct {
a int
}
func NewSquare(a int) *Square {
return &Square{a: a}
}
func (s *Square) Area() int {
return s.a * s.a
}
var _ Shape = new(Square)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment