rich840213 / goimportcycle

Tooling for Go import cycles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/goimportcycle@v1.0.5

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

License:Apache License 2.0


Languages

Language:Go 99.1%Language:Makefile 0.9%