October 2015
Beginner to intermediate
400 pages
14h 44m
English
All the types we’ve looked at so far have been concrete types.
A concrete
type specifies the exact representation of its values and exposes the
intrinsic operations of that representation, such as arithmetic for
numbers, or indexing, append, and range for slices. A concrete
type may also provide additional behaviors through its methods.
When you have a value of a concrete type, you know exactly what it
is and what you can do with it.
There is another kind of type in Go called an interface type. An interface is an abstract type. It doesn’t expose the representation or internal structure of its values, or the set of basic operations they support; it reveals only some of their methods. When you have a value of ...