Skip to content

pantsmann/goimportcycle

 
 

Repository files navigation

Go Import Cycle

Go Report Card

goimportcycle is a tool to visualize Go imports resolved to the package or file level.

Installation

go install github.com/samlitowitz/goimportcycle/cmd/[email protected]

Usage

goimportcycle -path examples/importcycle/ -dot imports.dot
dot -Tpng -o assets/example.png imports.dot

Example import graph resolved to the file level

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

Example import graph resolved to the package level

Red lines indicate import cycles between packages.

Tasks that probably should get done

  1. Make output graphs nicely organized (vague)

About

Tooling for Go import cycles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.1%
  • Makefile 0.9%