Go
7 articles
-
How to Implement Enums in Go with iota and Typed Constants
Use a named integer type, typed constants, iota, String methods, and explicit validation to build practical enum-like values in Go.
-
Using context.Context in Go: Cancellation, Timeouts, and Request-Scoped Values
Learn how to propagate cancellation and deadlines through Go code, clean up derived contexts, and avoid common API design mistakes.
-
Go Slices: What append, copy, and cap Actually Do to the Underlying Array
Learn how Go slice length, capacity, aliasing, append, and copy determine whether operations reuse or replace the underlying array.
-
Go Generics: How to Write Type Parameters, Constraints, and Generic Interfaces
Learn how Go type parameters are instantiated, how to choose constraints, and how to build generic functions, types, and interfaces.
-
Go for Loops: Range Semantics and Loop Variable Capture Before and After Go 1.22
Understand how Go 1.22 module boundaries change captured loop variables, how older code behaves, and how to make captures safe in earlier modules.
-
Managing Go Versions and Toolchains Across Projects
Use Go 1.21 or newer to declare each module’s minimum language version and let the go command select the toolchain requested by that project.
-
Using Maps in Go: Declarations, Lookups, and Iteration
Learn how to initialize Go maps, distinguish missing keys from zero values, delete entries, and iterate without relying on order.







