September 2018
Beginner
360 pages
9h 28m
English
After reading lesson 21, you’ll be able to
A vehicle is made up of many parts, and those parts may have associated values (or state). The engine is on, the wheels are turning, the battery is fully charged. Using a separate variable for each value is akin to the vehicle sitting in the shop disassembled. Likewise, a building may have windows that are open and a door that is unlocked. To assemble the parts or construct a structure, Go provides a structure type.
Whereas collections are of the same type, structures allow you to group disparate things together. Take a look around. What do you see ...
Read now
Unlock full access