go-callvis is a development tool to help visualize call graph of your Go program using Graphviz's dot format.
Intended purpose of this tool is to provide a visual overview of your program's source code structure by using call graph and type relations. This is especially useful in larger projects where the complexity of the code rises.
- focus specific package in a program
- group funcs by packages and/or types
- limit packages to custom prefix path
- ignore packages containing custom prefix
How it works
Use the following commands to install:
go get -u github.com/TrueFurby/go-callvis cd $GOPATH/src/github.com/TrueFurby/go-callvis make
go-callvis [OPTIONS] <main pkg> Options: -focus string Focus package with name (default: main). -limit string Limit package path to prefix. -group string Grouping by [type, pkg] (separated by comma). -ignore string Ignore package paths with prefix (separated by comma). -tests Include test code. -debug Enable verbose log. -version Show version and exit.
Packages & Types
Presented as subgraphs (clusters).
- packages have normal corners and label on the top
- types have rounded corners with label on the bottom
||green color :collision: NEW!|
Presented as nodes.
Presented as edges.
Here is example for project syncthing.
go-callvis -focus upgrade -group pkg,type -limit github.com/syncthing/syncthing -ignore github.com/syncthing/syncthing/lib/logger github.com/syncthing/syncthing/cmd/syncthing | dot -Tpng -o syncthing.png
You can find more examples in the folder examples.
Ideal goal of this project is to make web app that would locally store the call graph data and then provide quick access of the call graphs for any package of your dependency tree. At first it would show an interactive map of overall dependencies between packages and then by selecting particular package it would show the call graph and provide various options to alter the output dynamically.
execution takes a lot of time, because currently:
- the call graph is always generated for the entire program
- there is yet no caching of call graph data