3 ms·
Thanks for the example. Playing with the example a little bit left me with a nice feeling about Go's structural typing: - Passing a ReaderCloser reference to
by epidemian 13y ago
Thanks for the example.
Playing with the example a little bit left me with a nice feeling about Go's structural typing:
- Passing a ReaderCloser reference to a function that expects a Reader is possible: http://play.golang.org/p/PZCKvmp5Sj http://play.golang.org/p/PZCKvmp5Sj
- Composing interfaces, though very useful, is not required in order to make one a proper subtype of the other: http://play.golang.org/p/fXn0zzM60D http://play.golang.org/p/fXn0zzM60D