~/talk

Using Interfaces in Go

Talkat GopherCon Europe 2020 · 2020-06-15..06-18· [go]
slides:none on file

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

  1. 0:00Start
  2. 4:00Why don't we just get interfaces in Go?
  3. 6:52An interface is 2 things
  4. 9:32Interface in Go help you do much more than just defining a behaviour set.
  5. 12:35How do you extend the Shape interface to include a perimeter behaviour in Java?
  6. 16:28The I in SOLID - The Interface Segregation Principle.
  7. 20:12In Conclusion.. - Yes. Go interface help you specify
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.