You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Any best practices around how to use
dig
with a project that has multiple nested dependencies?As in, main --> route --> endpoint --> handler --> ...
I am exploring the option to let each component register itself, instead of referencing 4 level deep things in my main.
My goal is to keep main.go clean by ensuring that each module registers and resolves its dependencies internally.
ModuleB is dependency to ModuleA:
ModuleA:
main only knows about moduleA:
But this time, I happen to carry the container deep in my dependency chain, which is tolerable.
What are the best practices you've been using?
Beta Was this translation helpful? Give feedback.
All reactions