3 ms·
As someone who doesn't use Go, how would one handle a situation where two modules actually depend on each other? For example, a parent object owning a child obj
by colejohnson66 3y ago
As someone who doesn't use Go, how would one handle a situation where two modules actually depend on each other? For example, a parent object owning a child object is normal, but what if that child object sometimes needs a (weak) reference to the parent?
- nikbackm 3y agoJust put them in the same module?
- dale_glass 3y agoWhat if the child is an user-implemented piece of code and the parent is in a library?
- Kranar 3y agoThen there wouldn't be a circular dependency. If the parent is in a library and was written independently of the child, then the parent could not possibly import the child.