-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
Milestone
Description
I understand that disallow import cycle is intentional in Go design.
However, solving the import cycle issue makes me frustrated.
And, it is easy to write two coupling components that rely on each other
- Although we can use
interfacecan address the issue, it decreases the readability since a developer must carefully read the source to find out which instance is represented by the interface (abuse ofinterface). - There are many Go standard package rely on runtime private calls and uses
go:linknameto address the import cycle problem. However, it is still a hack and not recommended by the Go team.
I believe many people encounter import cycle issue and spend time on code refactoring, which is good, but this is unforgivable in business logic development sometimes.
Concern: How much compile time will be sacrificed while introducing dependency analysis? Is there any recent research advances for rapid dependency analysis can be integrated?
UFOXD, chentaosheng, Nicnl, eliaperantoni, salif and 3 morezegl, JekaMas, adelowo, caucy, VadimKorniychuk and 13 moreadelowoUFOXD