O'Reilly logo

Get Programming with Go by Nathan Youngman and Roger Peppé

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required