Interfaces
suggest changeAn 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents