typeover
curriculum

Curriculum Types & methods Structs exercise 9 · freeform

Structs


About this theme

type Foo struct { ... }. A struct is a typed record — fields and their types, nothing else. No methods on the struct itself (those come next). Field access with .. Struct literals can be positional or named; named is the only sane choice for anything with more than two fields.