#Programming Language

189 posts

Go Practice #4 DB Integration — database/sql and Transactions
7 min read

Go Practice #4 DB Integration — database/sql and Transactions

database/sql basics, prepared statements, transactions, and connection pool tuning. Plus higher-level tools like sqlc, sqlx, and GORM.

Go Practice #3 JSON I/O and Input Validation
6 min read

Go Practice #3 JSON I/O and Input Validation

Marshal/Unmarshal in encoding/json, struct tags, decoding error handling, and patterns for safe input validation.

Go Practice #2 Routing — Go 1.22+ ServeMux
5 min read

Go Practice #2 Routing — Go 1.22+ ServeMux

Method/pattern matching in the standard ServeMux from Go 1.22+. Where external routers like chi or gorilla/mux still fit.

Go Practice #1 First HTTP Server
5 min read

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
6 min read

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
5 min read

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
6 min read

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
5 min read

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
6 min read

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
6 min read

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
8 min read

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
7 min read

Go Intermediate #7 Standard Library Tour

Frequently used parts of Go's standard library — io, fmt, strings, time, sort, encoding/json — in one sweep.