3 ms·
>... and boilerplate to satisfy the interfaces. Go actually provides facilities for embedding types which helps remove some of the unnecessary boilerplate from
by drbawb 13y ago
>... and boilerplate to satisfy the interfaces.
Go actually provides facilities for embedding types which helps remove some of the unnecessary boilerplate from satisfying an interface.[1]
Through embedding you can leverage the implementation of an existing type to satisfy an interface w/o writing methods to dispatch to that underlying type.
[1]: http://golang.org/doc/effective_go.html#embedding http://golang.org/doc/effective_go.html#embedding
- pjmlp 13y agoI used Go quite a lot until version 1.0 got released. You are not explaining nothing new to me.