Skip to content

A tiny tool to draw a graph of golang package import relationship

Notifications You must be signed in to change notification settings

yqylovy/goimportdot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GoImportDot

What is GoImportDot ?

GoImportDot is a tiny tool to generate a dot file (used for Graphviz) of imports of golang package.It has two purpose.

  • Help people quickly understand how a package organization without going into details of code.
  • Help people find out whether a package is too confusing and needs to be refactored.

Quick Start

go get -u github.com/yqylovy/goimportdot
goimportdot -pkg=yourpackagename > pkg.dot 
dot -Tsvg pkg.dot >pkg.svg

Example

Install go.uber.org/zap

go get go.uber.org/zap

Get a graph of go.uber.org/zap

goimportdot -pkg=go.uber.org/zap > zap.dot
dot -Tpng zap.dot > zap.png

zap

Only get a graph of zapcore in go.uber.org/zap

goimportdot -pkg=go.uber.org/zap -root=go.uber.org/zap/zapcore > zapcore.dot
dot -Tpng zapcore.dot > zapcore.png

zap

About

A tiny tool to draw a graph of golang package import relationship

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages