3 ms·
The relevant part of Effective Go is here: http://golang.org/doc/effective_go.html#blank_implements http://golang.org/doc/effective_go.html#blank_implements It
by rakoo 12y ago
The relevant part of Effective Go is here: http://golang.org/doc/effective_go.html#blank_implements http://golang.org/doc/effective_go.html#blank_implements
It allows you to make sure fancyWriter implements all those interfaces, so that any future refactoring that breaks compatibility breaks at compile time.
You know how Go makes interfaces concordance implicit ? Whatever has a Read() method is a io.Reader without asking for it ? This explicitly tells the compiler (and other developers) the same thing.
- Sphax 12y agoThank you, I read the wrong part of effective Go apparently, didn't see this. It's clear now.