~/talk

Build and Test Caching in Go

Talkat GopherCon 2020 · 2020-11-09..11-13· [testing, go]
links:none on file
slides:none on file

Explains how Go caches at the package-level .a files using a SHA-256 checksum of all inputs, stores cache entries in a filesystem split into 256 directories, and uses action files that map input checksums to output checksums so rebuilds are avoided. Contrasts Make (mtime-based; misses rebuilds when commands change) and Bazel (hermetic, fast but heavy cache and long startup). Describes test caching that records syscalls getenv chdir stat open and rechecks those values before reusing cached test output, and CI advice to download and reupload $GOCACHE.

AI-written summary · about

  1. 0:00Start
  2. 0:17Build and Test Caching
  3. 0:57Build caches: avoid 'slow to compute'
  4. 12:44Cache key: any input that can change
  5. 13:29Checksum
  6. 20:48Buuuut... tests aren't just source code! 1. Files in testdata dir 2. Environment variables (TZ, db config) 3. Subcommands
~/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.