goimportcycle
is a tool to visualize Go imports resolved to the package or file level.
go install github.com/samlitowitz/goimportcycle/cmd/[email protected]
goimportcycle -path examples/importcycle/ -dot imports.dot
dot -Tpng -o assets/example.png imports.dot
Red lines indicate files causing import cycles between packages. Packages involved in a cycle have their backgrounds colored red.
goimportcycle -path examples/importcycle/ -dot imports.dot -resolution package
dot -Tpng -o assets/example.png imports.dot
Red lines indicate import cycles between packages.
- Make output graphs nicely organized (vague)