#Go
35 posts
Go Practice #1 First HTTP Server
The smallest server, started with the single net/http package. ListenAndServe, HandleFunc, ResponseWriter, and graceful shutdown.
Go Advanced #7 Code Generation — go generate and stringer
A path that avoids reflect's runtime cost — compile-time code generation. The go generate workflow, plus tools like stringer and mockgen.
Go Advanced #6 Profiling — pprof and benchmark
Measuring CPU, memory, and goroutine profiles with go test -bench and pprof. Addressing performance with measurement instead of guesswork.
Go Advanced #5 unsafe and cgo — Outside the Safe Zone
unsafe.Pointer's four rules, cgo's tradeoffs, and why both should almost never be used.
Go Advanced #4 reflect Package — Handling Types at Runtime
reflect.Type and reflect.Value, reading struct tags, dynamic calls. The tool you see inside serialization libraries.
Go Advanced #3 Generics — Type Parameters and Constraints
Generics in Go 1.18. Type-parameter syntax, constraints, comparable and the ~ token, and when not to use them.
Go Advanced #2 Memory Model and the sync Package
Mutex, RWMutex, WaitGroup, Once, atomic — shared-memory synchronization tools beyond channels. Which to use when.
Go Advanced #1 Concurrency Patterns — fan-out, fan-in, pipeline
Standard concurrency patterns assembled from goroutines and channels — pipeline, fan-out/fan-in, and semaphores.
Go Intermediate #7 Standard Library Tour
Frequently used parts of Go's standard library — io, fmt, strings, time, sort, encoding/json — in one sweep.
Go Intermediate #6 Testing — testing Package and Table-Driven
Writing unit tests and benchmarks with Go's standard testing package, and the table-driven test pattern that's standard in Go code.
Go Intermediate #5 context.Context in Depth
Go's standard tool for cancellation, timeouts, and request-scoped values. Why context becomes the skeleton of concurrent code.
Go Intermediate #4 select and Timeouts
The select statement for handling multiple channels at once, plus practical patterns like timeout, cancellation, and non-blocking communication.