Skip to content

funcGo()[]Article

Language fundamentals, concurrency, and idiomatic patterns for production Go code.

Go

Defer, Panic, and Recover in Go

How defer actually schedules a call, what panic does to the call stack, why recover only works inside a deferred function, and the real-world pattern of recovering from panics in HTTP middleware — with diagrams.

7 min
Go

Error Handling in Go: Custom Errors, Wrapping, and errors.Is/As

Why Go treats errors as ordinary values instead of exceptions, how to build custom error types, how wrapping with %w preserves the original cause, and how errors.Is and errors.As actually work — with diagrams.

6 min
Go

Go Modules and Packages: Setting Up and Structuring a Go Project

What a Go module actually is, how go.mod and go.sum work, how packages and import paths map to directories, and how to structure a project before you write your first real program.

6 min
Go

Pointers in Go: When to Use *T and Why

What a pointer actually is, why Go passes everything by value by default, and the concrete rule for when a function or method should take a pointer instead of a copy — with diagrams.

6 min
Go

Slices, Arrays, and Maps in Go: How They Actually Work

Why a slice is a small header pointing at a backing array, what append actually does when it grows, why slicing can alias memory you didn't mean to share, and how Go's maps behave — with diagrams.

6 min
Go

Structs, Methods, and Composition in Go

How to define your own types with structs, attach behavior with methods, and build up functionality through embedding instead of inheritance — with diagrams and real examples.

5 min
Go

sync.WaitGroup, sync.Mutex, and the Race Detector in Go

How to wait for a group of goroutines to finish with WaitGroup, protect shared state with Mutex when a channel is overkill, and catch data races before they reach production with go test -race — with diagrams.

7 min
Go

Understanding HTTP Servers in Go: From TCP Listen to Your First Handler

What actually happens when you call http.ListenAndServe: TCP listen and accept, the goroutine-per-connection model, the Handler interface, routing, and the timeouts a real server needs — with diagrams and a runnable example.

8 min
Go

Goroutines and Channels in Go: A Fresher-Friendly Guide

A beginner's guide to Go concurrency: what a goroutine actually is, every channel type (unbuffered, buffered, directional), select, and a worker pool example that ties it all together — with diagrams.

10 min
Go

Advanced Go Concurrency: Worker Pools, Backpressure and Bounded Concurrency

Why unbounded goroutines don't scale: semaphore-based bounded concurrency, backpressure, errgroup, goroutine leaks, and a real benchmark comparing the two.

13 min
Go

Building Background Workers in Go with Goroutines and Channels

A production-oriented worker pool in Go: bounded concurrency, graceful shutdown, panic recovery, and why 'go process(job) for every job' is dangerous.

12 min
Go

Graceful Shutdown in Go HTTP Servers

Implement graceful shutdown for Go HTTP servers: handling SIGTERM and SIGINT, draining active requests, shutdown timeouts, and Kubernetes readiness.

9 min
Go

Go Interfaces: Design Small, Testable Components

Design small, focused Go interfaces for dependency injection, mocking, and testable backend code, with realistic service and repository examples.

9 min
Go

Context in Go: Cancellation, Deadlines and Request Propagation

Understand Go's context.Context: cancellation, deadlines, timeouts and request-scoped propagation, with practical HTTP and database examples.

10 min