Using Interfaces in Go
summary
Argues that Go interfaces are implicit behavior types not Java-style contracts and demonstrates with a ship interface split into small composed pieces (area and perimeter) so a Circle implements area = 78.5 and perimeter = 31.4 without changing upstream code. Shows detached methods keep structs data-centric, cites interface segregation and Rob Pike’s “small interfaces” advice, and points to Go’s ecosystem examples like io.Reader/io.Writer and the empty interface averaging very few methods.
AI-written summary · about
chapters (7)
- 0:00Start
- 4:00Why don't we just get interfaces in Go?
- 6:52An interface is 2 things
- 9:32Interface in Go help you do much more than just defining a behaviour set.
- 12:35How do you extend the Shape interface to include a perimeter behaviour in Java?
- 16:28The I in SOLID - The Interface Segregation Principle.
- 20:12In Conclusion.. - Yes. Go interface help you specify








