Transform and choose data representations
16 articles
-
Transform and choose data representations
How to Clone a Map in Go Without Sharing the Underlying Values
Learn when maps.Clone is enough, why reference-valued entries still alias, and how to write a true deep copy for maps containing slices.
-
Transform and choose data representations
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.
-
Transform and choose data representations
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.
-
Transform and choose data representations
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.
-
Transform and choose data representations
Go for Loops: Choose a Loop Form, Read Range Values, and Avoid Capture Bugs
Choose a Go for-loop form, understand the values supplied by range, and recognize loop-variable capture under the semantics described in the Go 1.21 preview.
-
Transform and choose data representations
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.






