Structs
8 lessons
- 01Introduction to StructsHow to represent structured data by grouping different variable types in Go.
- 02Nested StructsCreating complex data structures by nesting structs within each other.
- 03Anonymous StructsHow to define and use structs without a name for one-time data shapes.
- 04Embedded StructsUnderstanding data-only inheritance and field promotion in Go structs.
- 05Struct MethodsHow to define behavior for structs using functions with receivers.
- 06Memory LayoutHow the order of fields in a struct affects memory usage due to alignment and padding.
- 07Empty StructsWhy empty structs are useful for memory-efficient signaling in Go.
- 08Structs CheatsheetA quick reference for struct definition, embedding, methods, and optimization.