|
|
|
|
|
by jesstaa
4241 days ago
|
|
You can make an io.Reader interface in any language.
Interfaces don't really shine until you start composing them. Say you have a type that implements the io.Reader, io.Writer, io.Closer and io.Seeker interfaces, eg. an os.File. This type would also automatically implement io.ReadCloser, io.WriteCloser, io.ReadWriter and io.ReadWriteCloser, io.ReadSeeker, io.ReadWriteSeeker, io.ReadWriteSeekerCloser, io.WriteSeeker, io.SeekCloser etc. |
|