$Id: 24

$SOId: 9010008c

An interface defines a set of methods on a struct.

Zero value of interface is nil.

Here’s the definition of the io.Reader interface from the standard library:

type Reader interface {
    Read(p []byte) (n int, err error)
}

The smaller the interface, the better.

Learn more about interfaces.