Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is all common place in Go, we just don't use the terms that you have associated with heavy weight frameworks. DI is simply assembling all the pieces of your application in one single place instead of breaking it up arbitrarily in dozens of different constructors. The first is easier to read and test than the second.

Factories are just functions or objects that can create new instances of a thing of the number or configuration of that thing can't be known at compile time.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: