go callvis
v0.7.0
Go-Callvis是一種開發工具,可幫助可視化使用Interactive視圖的GO程序的呼叫圖。
該工具的目的是使用Call Graph及其與軟件包和類型的關係為開發人員提供GO程序的視覺概述。這在較大的項目中特別有用,因為代碼的複雜性更高,或者只是只是試圖了解別人的代碼。

查看上圖的源代碼。
它運行指針分析以構建程序的呼叫圖,並使用數據以DOT格式生成輸出,可以使用GraphViz工具渲染。
-graphviz標誌)要安裝Go-Callvis,請運行:
# Latest release
go install github.com/ofabry/go-callvis@latest
# Development version
go install github.com/ofabry/go-callvis@master或者,克隆存儲庫並編譯源代碼:
# Clone repository
git clone https://github.com/ofabry/go-callvis.git
cd go-callvis
# Compile and install
make install要使用為專注軟件包的SVG圖像提供的Web服務器提供的交互式視圖,您可以簡單地運行:
go-callvis <target package>
http服務器正在http:// localhost:7878/默認情況下偵聽,使用選項-http="ADDR:PORT"以更改http服務器地址。
要生成一個單個輸出文件使用選項-file=<file path>選擇輸出文件目標。
輸出格式默認為svg ,使用選項-format=<svg|png|jpg|...>選擇其他輸出格式。
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.
-rankdir
Direction of graph layout [LR | RL | TB | BT] (default "LR")
-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.
運行go-callvis -h列出所有受支持的選項。
在這裡,您可以找到各種輸出的描述。
| 代表 | 風格 |
|---|---|
focused | 藍色 |
stdlib | 綠色 |
other | 黃色 |
| 代表 | 風格 |
|---|---|
exported | 大膽的邊界 |
unexported | 正常邊界 |
anonymous | 虛線邊界 |
| 代表 | 風格 |
|---|---|
internal | 黑色 |
external | 棕色 |
static | 實線 |
dynamic | 虛線 |
regular | 簡單的箭頭 |
concurrent | 帶有圓圈的箭頭 |
deferred | 用鑽石箭 |
這是項目同步的示例。

查看更多示例和使用的命令選項。
加入gophers.slack.com的#go-callvis頻道。 (還不是會員?獲取邀請)
您是否找到了任何錯誤或有一些建議?
您想為該項目做出貢獻嗎?
該項目的理想目標是製作可以在本地存儲呼叫圖數據的Web應用程序,然後為您的依賴關係樹的任何包裝提供快速訪問呼叫圖。首先,它將顯示軟件包之間整體依賴關係的交互式圖,然後選擇特定的軟件包,它將顯示呼叫圖並提供各種選項以動態更改輸出。