Types

Types give the user the ability to store values in mnemonic names. All programming languages have types related with numbers (to store integers, negative numbers, or floating point for example) with characters (to store a single character) with strings (to store complete words) and so on. Go language has the common types found in most programming languages:

  • The bool keyword is for Boolean type which represents a True or False state.
  • Many numeric types being the most common:
    • The int type represents a number from 0 to 4294967295 in 32 bits machines and from 0 to 18446744073709551615 in 64 bits.
    • The byte type represents a number from 0 to 255.
    • The float32 and float64 types are the set of all IEEE-754 64/-bit floating-point numbers respectively. ...

Get Go Design Patterns 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.