O'Reilly logo

Go: Design Patterns for Real-World Projects by Mat Ryer, Mario Castro Contreras, Vladimir Vivien

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

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 is a signed integer type, so int type represents a number from -2147483648 to 2147483647 in 32 bits machines
    • 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.
    • You also ...

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