~/talk

The Road to CGO-Less is Paved

Talkat GopherCon Europe 2023 · 2023-06-26..06-29· [go, compilers-and-language-design]
slides:none on file

Disabling CGo does not guarantee a C-free, static binary across platforms: building with CGO_ENABLED=0 can still pull in libc or DLLs on macOS, OpenBSD and Windows, and DNS and user lookups may switch between pure-Go and C-backed resolvers unless you set build tags like netgo and osusergo. Evidence comes from ldd outputs, runtime linker directives and differing behavior between Go 1.19 and Go 1.20. On Linux a fully static result is more likely, but results vary and change with Go releases.

AI-written summary · about

  1. 0:00Avoiding C in Go
  2. 1:03Myth of CGO-free binaries
  3. 2:29OS user package differences
  4. 7:09Syscalls truly C-free?
  5. 10:01Go’s syscall across OSes
  6. 13:38Darwin’s syscall API limits
  7. 15:25Windows syscalls and kernel32
  8. 17:14Net package DNS resolver
  9. 20:48DNS without CGO
  10. 23:00Inconsistent host lookups
  11. 25:44Static builds and CGO
  12. 27:06Go 1.20 improvements
  13. 28:32C compiler in CGO builds
  14. 29:57Disabling CGO consequences
~/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.