~/talk

Go - Best practices

Talkat Conf42 Golang 2022 · 2022-03-29..03-30· [go, developer-experience]
slides:none on file

Covers concrete Go gotchas and fixes: examples show pass-by-reference for slices and arrays so modifying a slice updates the original backing array; := variable shadowing creates unexpected local variables; slices keep larger capacity and share addresses; len counts bytes so use RuneCountInString for Unicode; ^ is unary bitwise NOT and binary XOR; defer evaluates call arguments immediately and defers execution LIFO; loop-closure goroutines require copying loop vars; use labeled break to exit nested loops and recover only inside deferred functions.

AI-written summary · about

  1. 0:00Introduction
  2. 1:13Pass by reference in Go
  3. 3:41Variable shadowing
  4. 5:45Slices memory sharing
  5. 7:29String length Unicode
  6. 8:10Logical operators caret
  7. 9:12Integer overflow loops
  8. 11:03Labels break loops
  9. 12:30Defer argument evaluation
  10. 14:14Defer LIFO order
  11. 15:18Goroutine closure issue
  12. 17:06Recovering from panics
  13. 18:41Closing remarks
~/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.