Hacker News new | past | comments | ask | show | jobs | submit login

> 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).




No, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: