Library / SDK
ondrajz/go-callvis avatar
ondrajz/go-callvis

go-callvis draws a Go call graph with pointer analysis

Visualize call graph of a Go program using Graphviz

6,527 stars429 forksGoMIT

At a glance

What is it?
Point it at a package and it runs pointer analysis, writes the call graph in dot format, and serves it as SVG images on port 7878. The web application it grew into was later split off into a different project.
Who is it for?
go-callvis earns its place when you are reading a package you did not write and want its call structure in one click, and for CI when one package and one file are enough. Skip it if you need a graph stored across sessions or a dependency tree walk, since neither appears in the flag list.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 7 months ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ondrajz/go-callvis6,527 ★ · +3
Star history
Repository2026-09-232026-11-15
ondrajz/go-callvis6.5k6.5k

3 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Pointer analysis produces dot, and dot produces the picture

Everything go-callvis draws comes from one step. It runs pointer analysis, the analysis package documented under golang.org/x/tools/go/pointer, over the program you name on the command line, and builds a call graph from the result. That graph is written in dot format, the language Graphviz reads, and rendering is a separate step. Graphviz is listed as an optional requirement, needed only when you pass the -graphviz flag. The module already carries github.com/goccy/go-graphviz v0.1.2 next to golang.org/x/tools v0.28.0 and github.com/pkg/browser, so a rendering path exists inside the tool itself. The source tree follows the pipeline in its file names: analysis.go, dot.go, dot_cgo.go, dot_nocgo.go, handler.go, output.go, main.go and version.go, and the Makefile injects a commit stamp through -X main.commit.

The install command names github.com/ofabry, not this repository

Two owner names show up in this project and only one of them is the repository you are reading. The install commands, the clone URL and the module line in go.mod all say github.com/ofabry/go-callvis, while the files here live under ondrajz/go-callvis. Copy the documented command as written:

sh
go install github.com/ofabry/go-callvis@latest

The development variant swaps the version suffix for the branch:

sh
go install github.com/ofabry/go-callvis@master

Or compile the source yourself:

sh
git clone https://github.com/ofabry/go-callvis.git
cd go-callvis
make install

The stated requirements are Go 1.19+ and Graphviz, the latter optional unless you pass -graphviz. The module file is stricter than that list: go.mod declares go 1.22.0 with toolchain go1.23.1, so the tree needs a newer toolchain than the requirement line suggests. The Makefile install target threads its own tags, ldflags and build arguments into go install, and the same file cross-compiles for linux and darwin on amd64.

A server on port 7878, or one file with -file

Named with a target package, the tool starts a web server:

sh
go-callvis <target package>

The default service address is :7878 and the README sends a browser to http://localhost:7878/. The server hands out SVG images of the focused package, and clicking a package in the picture switches the focus, which is the interaction the tool is built around. If you want an artifact instead of a listener, pass -file with a destination path. The help text describes that flag as the output filename and says to omit it to use server mode, so the two are alternatives rather than a combined mode. The format defaults to svg and -format takes svg, png, jpg or other values the renderer accepts. A long-lived server suits code you are still learning; a single file suits a build log or a pull request comment. The tool does not give you both in one run.

The eight flags in the help output, and what each one changes

The README's option list is short enough to read in one screen:

code
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")

-focus takes a package name or an import path and defaults to main, so a bare run looks at the command's own package. -group accepts pkg, type or both, comma separated, and decides whether functions are drawn per package or per receiver type, which matches the promise to group methods by receiver type. -graphviz is the switch that makes the external Graphviz installation mandatory. -debug turns on verbose logging, -http moves the listener, -format picks the image format and -file picks the destination. Run go-callvis -h on your own build to confirm the list.

The feature list promises filters the flag table does not name

The README's feature list names more than the eight flags in its options block. It says you can filter packages to specific import path prefixes, ignore calls to and from the standard library, and omit various types of function calls. None of those three has a flag in the options block the README prints, and the README says to run go-callvis -h to list all supported options. The README does not show which switch enables a prefix filter or drops a class of call. If a review depends on seeing only your own import paths, run go-callvis -h on your build to find the option.

Colours, borders and arrow shapes are the whole legend

The reference guide is a set of tables, and it doubles as the explanation of what you are looking at. Packages and types come in three colours: the focused package in blue, the standard library in green, everything else in yellow. Functions and methods are separated by border weight instead, with a bold border for exported functions, a normal border for unexported ones and a dotted border for anonymous ones. Edges carry two properties at once. Internal calls are drawn in black and external ones in brown. A static call is a solid line, a dynamic call a dashed one. A plain arrow is a regular call, an arrow with a circle marks a concurrent call and an arrow with a diamond marks a deferred one. That is a lot of meaning packed into one picture, and these tables are the only place it is written down, so a screenshot taken without them leaves the reader guessing what a circle is.

-cacheDir stops re-rendering, and nothing documents the key

One flag is about repeated work rather than output: -cacheDir, described as enabling caching to avoid unnecessary re-rendering. The README does not say what goes into the cache key, whether it takes your flags into account, where the directory should sit, or how to invalidate it. That gap is worth more attention than it first appears, because the flags most likely to change are the ones you change most: point -focus at an internal package instead of main and the same directory may serve an image built for the earlier setting if the key ignores focus. There is also no mention of whether the cache follows a change to -group or -format. Read the cache as an optimisation worth verifying once rather than a switch to leave on forever, and keep the directory inside your build workspace so clearing it is a normal step.

The interactive web app became a separate project

The README closes on a roadmap note that changes how you should read the tool. The interactive application it describes has been published as a separate project, goexplorer, whose stated goal is a web app that keeps call graph data locally and gives quick access to call graphs for any package in a dependency tree. go-callvis stays one level below that: the package you focus, the functions it groups, the calls between them, rendered as dot. It does not retain a graph across sessions, walk a dependency tree, or hold two versions of the same graph side by side. If you want a picture for whatever package you are reading in a large tree, that is the other project. If you want a repeatable picture of one package that you can paste into an issue, the eight flags are enough. The repository was last pushed to on 2026-03-30, and release v0.7.1 was published on 2025-01-02, after v0.7.0 in 2023 and v0.6.1 in 2020, so check the flag list against your own build rather than assuming it matches an older tutorial.

Editorial conclusion

go-callvis earns its place when you are reading a package you did not write and want its call structure in one click, and for CI when one package and one file are enough. Skip it if you need a graph stored across sessions or a dependency tree walk, since neither appears in the flag list. Before adopting it, compare your toolchain against the go 1.22.0 line in go.mod rather than the README requirement, run go-callvis -h to see whether the eight flags cover the calls you need out of the picture, and note that the documented install command names github.com/ofabry/go-callvis while this repository lives under a different owner.

Frequently asked questions

What does go-callvis need installed besides Go?

Go 1.19+ and Graphviz, and the README marks Graphviz as optional, required only when you pass the -graphviz flag. The module file itself declares go 1.22.0 with toolchain go1.23.1.

Which address does the go-callvis server listen on?

The default HTTP service address is :7878 and the README points a browser at http://localhost:7878/. The -http flag takes another address in ADDR:PORT form.

Can go-callvis produce a PNG or a single output file?

Yes. The output format defaults to svg and -format accepts svg, png, jpg and other values. Passing -file with a path writes one file instead of starting the server.

How do I look at one package in go-callvis instead of the whole program?

The -focus flag takes a package name or an import path and defaults to main. The focused package is drawn in blue, standard library packages in green and everything else in yellow.

Does the go-callvis roadmap mention a separate project?

Yes. The README states that the interactive tool was published separately as goexplorer, a web app meant to store call graph data locally and give quick access to any package in a dependency tree.

Official sources

  1. License: MIT
  2. ondrajz/go-callvis on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ondrajz-go-callvis.svg)](https://hysenlabs.com/projects/ondrajz-go-callvis)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/ondrajz-go-callvis.svg)](https://hysenlabs.com/projects/ondrajz-go-callvis)

Was this useful?