Generics and internals
Type parameters, constraints, reusable data structures, reflection, memory, and runtime internals.
Go Type Parameters: Syntax and Constraints Explained
Learn golang type parameters by example: the [T Constraint] syntax, what each constraint unlocks, type inference, the ~ token, and the method limitation.
Read tutorial Lesson 3 · Tutorial · Go 1.21+Generic Functions in Go: Writing Reusable Code
Write golang generic functions the right way: Map, Filter, Reduce, and a drop-in utilities package. Every example tested on Go 1.24 with real output.
Read tutorial Lesson 4 · Tutorial · Go 1.21+ (cmp.Ordered); all examples tested on Go 1.24.7Go Constraints: comparable, Ordered and Custom Sets
Master Go generic constraints: type sets vs method sets, comparable, the ~ token, cmp.Ordered, and writing your own Number constraint. Tested on Go 1.24.
Read tutorial Lesson 5 · Tutorial · Go 1.24+ (GOMEMLIMIT needs Go 1.19+)Go's Garbage Collector Explained: How Memory Is Managed
How the Go garbage collector works: concurrent mark-and-sweep, escape analysis, GOGC and GOMEMLIMIT, plus cutting allocations with measured benchmarks.
Read tutorial Lesson 6 · Tutorial · Go 1.23+Generic Data Structures in Go: Stack, Queue and Set
Build Go generic data structures: a tested Stack, Queue, Set, and priority queue with iterators and concurrency guidance.
Read tutorial Lesson 7 · Tutorial · Go 1.18+ (all examples tested on Go 1.24.7)Go Reflection: When and How to Use reflect
Learn Go reflection the right way: the three laws, reflect.TypeOf and ValueOf, struct tags, settability, a tested validator, and when to avoid reflect.
Read tutorial