~/talk

Embedding

Talkat Golang UK 2017 · 2017-08-16..08-18· [go]
links:none on file
slides:none on file

Claim: embedding is not inheritance and behaves differently: the spec only allows embedding a named type T or T (T not a pointer), selectors resolve to the shallowest depth, and promotion evicts ambiguous methods so duplicate names are removed from the method set. Practical consequences: slices/arrays as embedded types are syntax errors, embedding interfaces can cause nil panics, JSON tags change marshal shape, and ambiguous embedding breaks interface implementation. Worked example: generated SDK pattern T embeds customT* preserves user code in production. GitHub: stabbycutyou/embeddingtalk.

AI-written summary · about

  1. 0:00Intro
  2. 2:18DEFINING EMBEDDING AND COMPOSITION
  3. 3:57HOW DOES IT DIFFER FROM CLASSICAL INHERITANCE?
  4. 7:07WELL. WHAT DOES THE SPEC SAY?
  5. 9:48POINTER TYPES
  6. 13:01SELECTORS
  7. 16:17CREATING AND SETTING
  8. 21:27EMBEDDING EXPORTED TYPES
  9. 23:27EMBEDDING INTERFACES IN STRUCTS
  10. 28:53MARSHALING AND UNMARSHMALINS
  11. 36:34EXTENDING GENERATED CODE
~/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.