Skip to content
gohacks.dev

Browse by topic

Find articles on the subject you are working with.

All topics

Basics

Types, slices, maps, structs and interfaces, and the small decisions that make Go code read like Go instead of Java with different braces.

Concurrency

Goroutines are cheap to start and expensive to get wrong. Channels, mutexes, context and the leaks and deadlocks waiting for anyone who skips the details.

Web

Servers, handlers, middleware, templates, cookies and sessions on net/http, plus the parts of a real website the tutorials leave out.

APIs

Designing JSON, REST and gRPC interfaces that other people have to live with: versioning, pagination, validation, errors and clients.

Testing

Table-driven tests, fakes over mocks, fuzzing, benchmarks and the habits that make a suite worth running on every save.

Databases

Talking to Postgres, MySQL, SQLite, Redis and friends without leaking connections, hand-building queries or fighting your migrations.

Performance

Profile first, then change something. pprof, allocations, the garbage collector, escape analysis and benchmarks that hold up in production.

Generics

Type parameters, constraints and iterators, and the honest answer to whether this particular function needed them at all.

DevOps

Getting a Go binary out the door and keeping it alive: containers, cross-compiling, CI pipelines, systemd, releases and rollbacks.

Security

Input you should not trust, crypto you should not roll yourself, TLS, secrets, dependency scanning and how Go code actually gets exploited.

Standard Library

The batteries that ship with Go. Check here before you add a dependency, because the answer is often already in the box.

Tooling

The go command, vet, linters, formatters, code generation, editors and the Git habits that keep a repository tidy.

Latest

Latest articles

The newest articles on the site.

All articles

Guides

Step-by-step guides

Complete walkthroughs with tested code and real output.

All guides

Get new articles by email

We send one email when a new article is published. No spam.

Unsubscribe in one click. No spam, ever.