Publish to my blog (weekly)
-
Structs and Interfaces — An Introduction to Programming in Go | Go Resources
- (c *Circle)
- “receiver”
- Person Person
- anonymous fields
- Person
- a.Person.Talk()
- a.Talk()
- The is-a relationship
- In our case both
Rectangle
andCircle
have area methods which returnfloat64
s so both types implement theShape
interface.
-
댓글