|
|
|
|
|
by azth
1569 days ago
|
|
Because golang doesn't have constructors, you're forced to implement functions that mimic them yourself. And the language still doesn't prevent you from directly instantiating the struct yourself, meaning it is always possible to bypass the "constructor functions". This is quite terrible and opens up your code to errors. Furthermore, DI frameworks also usually have lifecycle management, which is quite handy in many cases. |
|
You have a good point wrt lifecycle management, but I feel like that’s actually a separate class of problem.