~/talk

(Wrong) Comparison is the Thief of Joy

Talkat GopherCon Singapore 2025 · 2025-01-22..01-24· [soft-skills]
name:Elisa Xu
links:none on file
slides:none on file

Shows concrete gotchas and fixes for Go comparisons: slices can’t be == so use arrays or reflect.DeepEqual or testify; JSON unmarshals numbers to float64 (so []int ≠ unmarshaled data) and only exported fields are marshaled unless embedded; protobuf autogenerated types mutate internal message state when printed so naive reflect compares fail — use Reset, compare exported fields, or use the cmp options to ignore unexported fields; maps differ between nil and empty so check len or construct matching empty maps.

AI-written summary · about

  1. 0:00Introduction to comparison
  2. 1:04Comparing slices in Go
  3. 6:49Marshalling and unmarshalling data
  4. 11:31Custom types and exported fields
  5. 16:31Protobuf comparison pitfalls
  6. 24:29Clearing and comparing maps
  7. 27:58Closing thoughts on comparison
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.