Go Import Cycle

Go Report Card

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

Installation

go get -u github.com/samlitowitz/goimportcycle/cmd/goimportcycle

Usage

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

Example dot output for the above example

Tasks that should get done

  1. Display "main" package correctly

    Package "main" shown correctly

  2. Color edges involved in an import cycle differently from edges not involved in an import cycle

    Color import cycles

  3. Nest packages to reduce label length

    Nested packages

GitHub

View Github