October 2015
Beginner to intermediate
400 pages
14h 44m
English
An interface type specifies a set of methods that a concrete type must possess to be considered an instance of that interface.
The io.Writer type is one of the most widely used interfaces
because it provides an abstraction of all the types to which bytes can
be written, which includes files, memory buffers, network connections,
HTTP clients, archivers, hashers, and so on.
The io package defines many other useful interfaces.
A Reader represents any type from which you can read bytes, and
a Closer is any value that you can close, such as a file or a
network connection.
(By now you’ve probably noticed the naming convention for many of Go’s
single-method interfaces.)
package io type Reader ...
Read now
Unlock full access