[TOC]

go-callvis 是github上一个开源项目,可以用来查看golang代码调用关系。

安装

安装graphviz

$ brew install graphviz

安装go-callvis

go get -u github.com/TrueFurby/go-callvis
cd $GOPATH/src/github.com/TrueFurby/go-callvis && make

用法

$ go-callvis [flags] package

示例

以orchestrator项目为例,其代码已经下载到本地。

$ go-callvis github.com/github/orchestrator/go/cmd/orchestrator

如果没有focus标识,默认是main

github.com/github/orchestrator/go/http
$ go-callvis -focus github.com/github/orchestrator/go/http  github.com/github/orchestrator/go/cmd/orchestrator