Module 03 Β· Structs & Methods β Lesson 1 of 3 Β· ~9 min
Structs
A shape for your data
A PawWalk backend juggles walkers, dogs, bookings, GPS fixes. Each is a little bundle of related fields: a walker has a name and a price; a booking has a walker, a dog, and a time. In Go you describe that bundle with a struct β a named type made of fields.
If you did the iOS course, this is the same idea as Swift's struct Walker { ... }. Go's version is leaner: no class alternative to weigh it against, no inheritance, just fields and (next lesson) methods hung off them.