godag can help you analyse the pkg internal dependency
go get -u github.com/legendtkl/godag
godag --pkg_name=github.com/astaxie/beego --pkg_path=/Users/kltao/code/go/src/github.com/astaxie/beego --depth=1 --dot_file_path=a.dot
- 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 godag.dot in current dir.
You can use graphviz to visualize dot file.
dot -Tpng godag.dot > godag.png
dot -Tsvg godag.dot > godag.svg
With beego in depth=1, we got the png as follow.
brew install graphviz
yum or apt-get or source code
- Simple. We depend no third party package.
- Depth Support.
- Something else maybe.
- 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.
Welcome to contribute.