concept new type in category go

appears as: new types, new type, The new type
Get Programming with Go

This is an excerpt from Manning's book Get Programming with Go.

Your code can declare new types too, but we’ll come back to that in lesson 13.

  • Declare new types
  • A temperature isn’t a float64, though that may be its underlying representation. Temperature is a measurement in Celsius, Fahrenheit, or Kelvin. Declaring new types not only makes code clearer, it can help prevent errors.

    The type keyword declares a new type with a name and an underlying type, as shown in the following listing.