Talking to the OS
Systems Programming in Go
Go is a systems language — static binaries, a tiny runtime, and direct access to the OS. From
system calls and file descriptors to files, processes and signals, then
pipes and Unix sockets for IPC, each page pairs a clear mental model with idiomatic Go you can
run right here (or, for kernel-only calls, study in fenced examples).
Mark a topic “learned” on its page and watch the bars fill.
Skill map
Learned nodes light up — the glowing one is your next step. Click any node to jump in.
The OS Interface
Where Go meets the kernel — why Go suits systems work, system calls and the syscall/x/sys packages, file descriptors, and the standard streams.
Why Go excels at systems programming — static binaries, a tiny runtime, cross-compilation, and a toolchain that made it the language of infrastructure.
✦ Complete · ⏱ 5 min 2 · Intermediate System CallsHow Go asks the kernel for services — system calls, the syscall and x/sys packages, file descriptors, the standard streams, and tracing calls with strace/dtrace.
✦ Complete · ⏱ 9 minFiles & Directories
Working the filesystem — permissions, walking directory trees, computing sizes and finding duplicates, symlinks, temp files, and crash-safe atomic writes.
Working the filesystem in Go — permissions, reading and walking directories with WalkDir, computing directory sizes, finding duplicates by hash, and symlinks.
✦ Complete · ⏱ 5 min 4 · Intermediate Temp Files & Atomic WritesCrash-safe file writes in Go — temp files and directories, the write-temp-then-rename pattern for atomic updates, fsync, and avoiding half-written files.
✦ Complete · ⏱ 5 minProcesses & Events
Programs that react — launching processes with os/exec, handling OS signals for graceful shutdown, and scheduling, tickers, and watching the filesystem for changes.
Launching and managing external programs in Go — os/exec, wiring up stdin/stdout/env, Run vs Start vs Output, process IDs, and killing children.
✦ Complete · ⏱ 7 min 6 · Intermediate SignalsReacting to OS signals in Go — os/signal.Notify, catching SIGINT/SIGTERM for graceful shutdown, signal.NotifyContext, and ignoring or resetting signals.
✦ Complete · ⏱ 4 min 7 · Intermediate Scheduling & WatchingPrograms that wake on a schedule or a change — tickers and timers, cron-style scheduling, watching the filesystem with fsnotify, and log rotation.
✦ Complete · ⏱ 4 minIPC & Sockets
Talking between processes — anonymous and named pipes, Unix domain sockets (and HTTP over them), and memory-mapped files for zero-copy sharing.
The simplest IPC — anonymous pipes (os.Pipe, io.Pipe), named pipes (FIFOs), piping one process's output into another, and back-pressure.
✦ Complete · ⏱ 7 min 9 · Intermediate Unix SocketsFast local IPC — Unix domain sockets vs TCP, building a server over a Unix socket, and serving HTTP over one.
✦ Complete · ⏱ 5 min 10 · Advanced Memory-Mapped FilesMapping a file into memory — mmap via syscall/x/sys, accessing a file as a byte slice, zero-copy reads and shared memory, and when it wins (and when it doesn't).
✦ Complete · ⏱ 6 min🐹 Why Go shows up in your infrastructure
Docker, Kubernetes, etcd, Prometheus, Terraform — the cloud's plumbing is written in Go. A single static binary that cross-compiles anywhere, a runtime light enough to talk to the kernel directly, and goroutines that make "a process per connection" cheap: that combination is why Go quietly runs the machines under your machines.