depviz

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 8 Imported by: 0

README

:dvd: dependency visualization

Release Go Report Card Go Doc
Change Log Go Version MIT License

depviz 会把 Go 模块的依赖关系进可视化处理。

安装与更新

在命令行中输入以下内容,可以获取到最新版

$ go get -u github.com/jujili/depviz
$

使用

graph of main.go

上图由以下命令生成。

$ depviz -s -o -d=github.com,jujili,awalterschulze . | dot -Tpng -o main.png
$

帮助

$ depviz -h
$

详细说明

包分类

depviz 会把库分成三类

  • 感兴趣的(interested):包含了初始库及其子库,还有利用 --interested 标记的库。例如, --interested=github.com/jujili,github.com/aQuaYi 会把导入路径以 github.com/jujiligithub.com/aQuaYi 开头的库都标记为感兴趣的库。在图中,使用以蓝色方框显示。
  • 标准库(standard): 存放在 GOROOT 目录下的库,会被认为是标准库。使用 -s 来开启。在图中,以绿色圆形显示。注意,标准库只会是依赖图中的叶子节点。
  • 其他库(other):以上两类以外的其他库。使用 -o 来开启显示。在图中,以灰色方框显示。

简化导入路径

库文件的导入路径通常都比较长,为了简化显示,提供了 -delete 选项,可以简化为 -d。例如,-d=github.com,jujili 会把库 github.com/jujili/clock/sub 简化成 clock/sub 显示。 还可以直接使用 -short 选项,只显示库所在文件夹的名称。

参考文档

https://graphviz.gitlab.io/_pages/doc/info/attrs.html

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL