Unit 2. Types

The text "Go" and the number 28487 are both represented with the same zeros and ones on an x86 computer (0110111101000111). The type establishes what those bits and bytes mean. One is a string of two characters, the other is a 16-bit integer (2 bytes). The string type is used for multilingual text, and 16-bit integers are one of many numeric types.

Unit 2 covers the primitive types that Go provides for text, characters, numbers, and other simple values. When appropriate, these lessons reveal the benefits and drawbacks to help you select the most appropriate type.

Get Get Programming with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.