Generics and internals
Type parameters, constraints, reusable data structures, reflection, memory, and runtime internals.
Lesson 2 · Tutorial · Go 1.21+
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