3 ms·
> So everywhere you would use inheritance, you use composition instead? The stuff you'd have stuck in the superclass, you stick somewhere else and stick in your
by autarch 12y ago
> So everywhere you would use inheritance, you use composition instead? The stuff you'd have stuck in the superclass, you stick somewhere else and stick in your struct?
No, Go provides interfaces (aka traits or roles), which you can use to share composable functions (aka methods).
- stcredzero 12y agoNo, Go provides interfaces (aka traits or roles), which you can use to share composable functions (aka methods). I wasn't talking about creating conventions/apis/facades, rather about how one reuses code.