go-callvis介绍
go-callvis是一种golang代码可视化工具, go-callvis
官网有很详细的解答
运行依赖:
- Go 1.13+
- Graphviz (optional, required only with -graphviz flag)
go-callvis安装
go get -u github.com/ofabry/go-callvis
# or
git clone https://github.com/ofabry/go-callvis.git
cd go-callvis && make install
maka无法使用
如果windows中没有gcc, 可能还需要安装MinGW-w64
go-callvis使用
默认打开: http://localhost:7878/
go-callvis <target package>
go-callvis -focus github.com/syncthing/syncthing/cmd/syncthing -minlen 3 -group pkg,type -limit github.com/syncthing/syncthing -ignore github.com/syncthing/syncthing/lib/logger
github.com/syncthing/syncthing: 是包名
-limit
限制在指定的包中-ignore
忽略包-minlen
3 展开的深度
官方说明
Options
Usage of go-callvis:
-debug
Enable verbose log.
-file string
output filename - omit to use server mode
-cacheDir string
Enable caching to avoid unnecessary re-rendering.
-focus string
Focus specific package using name or import path. (default "main")
-format string
output file format [svg | png | jpg | ...] (default "svg")
-graphviz
Use Graphviz's dot program to render images.
-group string
Grouping functions by packages and/or types [pkg, type] (separated by comma) (default "pkg")
-http string
HTTP service address. (default ":7878")
-ignore string
Ignore package paths containing given prefixes (separated by comma)
-include string
Include package paths with given prefixes (separated by comma)
-limit string
Limit package paths to given prefixes (separated by comma)
-minlen uint
Minimum edge length (for wider output). (default 2)
-nodesep float
Minimum space between two adjacent nodes in the same rank (for taller output). (default 0.35)
-nointer
Omit calls to unexported functions.
-nostd
Omit calls to/from packages in standard library.
-skipbrowser
Skip opening browser.
-tags build tags
a list of build tags to consider satisfied during the build. For more information about build tags, see the description of build constraints in the documentation for the go/build package
-tests
Include test code.
-version
Show version and exit.
Run go-callvis -h
to list all supported options.