~/talk

From OOP to Go

Talkat GopherCon Europe 2022 · 2022-07-28..07-31· [go]
slides:none on file

Starting from a literal Java→Go translation, a logger built with embedded structs unexpectedly keeps calling the inner logger and prints to stdout instead of a file; the naive inheritance-like override fails at runtime. Fixes use interfaces and dependency injection: implement a logging target, then swap to the standard library io.Writer (notably implemented by 351 types), or embed an interface in a logger struct to compose behavior. The interface-based designs work; the inheritance-like approach does not.

AI-written summary · about

  1. 0:00Start
  2. 4:24What Is Oop
  3. 5:00Inheritance
  4. 8:34Embedded Structs
  5. 10:48Embedding Structs
  6. 13:14Practical Solution
  7. 15:41The Writer Interface
  8. 17:39Embedding an Interface Instead of Embedding a Struct
  9. 18:41Logger Struct
~/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.