~/talk

Stupid Gopher Tricks

Talkat Golang UK Conference 2015 · on Friday, 2015-08-21· [go]
slides:none on file

Shows concrete tricks that actually compile and have been used: use anonymous structs for one-off JSON and template payloads and embed a mutex in an anonymous struct to keep globals clean; take method values to pass bound receivers into sync.Once or register HTTP handlers; use the atomic package and read how atomic.Value stores interface words — it works but panics if you store different concrete types; spawn subprocess tests to isolate profiling and use go list -f plus graphviz to emit dependency SVGs.

AI-written summary · about

  1. 0:00Intro
  2. 1:51Anonymous structs template data
  3. 4:40Anonymous structs test cases (1/2)
  4. 5:15Anonymous structs test cases (2/2) You can go a step further and put the composite train the range statement itsel
  5. 5:34Embedded fields
  6. 6:27Anonymous structs embedded mutex
  7. 8:58Anonymous interfaces
  8. 10:07Method values A method value is what you get when you evaluate a method as an expression
  9. 12:16Method values: sync. Once The sync. Once type used to perform a task once with concurrency safety
  10. 14:00Method values: HTTP handlers
  11. 14:50Method values another example in package os/exec, the Ond type implement methods to set up
  12. 15:50Comparable types The Gospec defines a set of types as comparable
  13. 17:42Comparable types and map keys Any comparable type may be used as a mapkey.
  14. 18:42Structs as map keys An example from the Go continuous build infrastructures
  15. 32:13Subprocess tests
  16. 34:01Subprocess benchmarks (1/2)
  17. 35:34Subprocess benchmarks (2/2)
  18. 44:38go list generating dependency graphs
~/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.