I'm wondering why import cycle not allowed in Go. It seems to me forbid
import cycle make package init() function call a bit easier to reason but
it should not be a too hard issue to solve. A common use case of cyclic
import for me is to declare a common interface in top level package, then
make a few implementations in different sub-package, finally make some
convenient function like a factory to forward specific implementation in
top level package. However, forbid cyclic dependence make this process very
difficult and fragile, especially when there is multiple different
interface involved. Why this design choice is taken?
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.