Skip to content
godag can help you analyse the pkg internal dependency
Branch: master
Clone or download
Latest commit 5a81fba Apr 8, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information. fix typo Apr 8, 2018 remove debug log Apr 7, 2018
godag.png remove debug log Apr 7, 2018
godag.svg svg cmd Apr 7, 2018
main.go remove debug log Apr 7, 2018


godag can help you analyse the pkg internal dependency

1. How to Use

1. Install

go get -u

2. Run

godag --pkg_path=/Users/kltao/code/go/src/ --depth=1


  • pkg_name: (REQUIRED) the package name you want to analyze dependency
  • pkg_path: (REQUIRED) the package path in your computer
  • depth: (Optional) the code depth to analyze. For example, if depth is 1, we will only analyze the pkg dag: beego/cache, beego/context; if depth is 2, we will analyze the pkgs dag: beego/cache/redis, beego/cache/ssdb etc. The default value is 1.
  • dot_file_path: (Optional) the dot file path. The default value is in current dir.

3. Visualization

You can use graphviz to visualize dot file.

dot -Tpng > godag.png
dot -Tsvg > godag.svg

With beego in depth=1, we got the png as follow.

Install graphviz

brew install graphviz

yum or apt-get or source code

2. Features

  • Simple. We depend no third party package.
  • Depth Support.
  • Something else maybe.

3. Weakness

  • Support only third path package analyze. That means, if you want to analyze your local project, you might need to modify the code or contact me.

4. Contributer

Welcome to contribute.


You can’t perform that action at this time.