Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-callvis

> 编程语言
Open source

Visualize call graph of a Go program using Graphviz

6.5K stars0 likes3 views
WebsiteGitHub

About

Visualize call graph of a Go program using Graphviz

go-callvis

go-callvis is a development tool to help visualize call graph of a Go program using interactive view.


Introduction

The purpose of this tool is to provide developers with a visual overview of a Go program using data from call graph and its relations with packages and types. This is especially useful in larger projects where the complexity of the code much higher or when you are just simply trying to understand code of somebody else.

Features

  • click on package to quickly switch the focus using interactive viewer
  • focus specific package in the program
  • group functions by package
  • group methods by their receiver type
  • filter packages to specific import path prefixes
  • ignore calls to/from standard library
  • omit various types of function calls

Output preview

Check out the source code for the above image.

How it works

It runs pointer analysis to construct the call graph of the program and uses the data to generate output in dot format, which can be rendered with Graphviz tools.

Quick start

Installation

Requirements

  • Go 1.19+
  • Graphviz (optional, required only with -graphviz flag)

To install go-callvis, run:

bash
# Latest release
go install github.com/ofabry/go-callvis@latest

# Development version
go install github.com/ofabry/go-callvis@master

Alternatively, clone the repository and compile the source code:

bash
# Clone repository
git clone https://github.com/ofabry/go-callvis.git
cd go-callvis

# Compile and install
make install

Usage

Interactive viewer

To use the interactive view provided by a web server that serves SVG images of focused packages, you can simply run:

go-callvis <target package>

HTTP server is listening on http://localhost:7878/ by default, use option -http="ADDR:PORT" to change HTTP server address.

Render static output

To generate a single output file use option -file=<file path> to choose output file destination.

The output format defaults to svg, use option -format=<svg|png|jpg|...> to pick a different output format.

Options

…

Run go-callvis -h to list all supported options.

Reference guide

Here you can find descriptions for various types of output.

Packages / Types

Represents Style
focused blue color
stdlib green color
other yellow color

Functions / Methods

Represents Style
exported bold border
unexported normal border
anonymous dotted border

Calls

Represents Style
internal black color
external brown color
static solid line
dynamic dashed line
regular simple arrow
concurrent arrow with circle
deferred arrow with diamond

Examples

Here is an example for the project syncthing.

Check out more examples and used command options.

Community

Join #go-callvis channel at gophers.slack.com. (not a member yet? get invitation)

How to help

Did you find any bugs or have some suggestions?

  • Feel free to open new issue or start discussion in the slack channel.

Do you want to contribute to the project?

  • Fork the repository and open a pull request. Here you can find TODO features.

Roadmap

The interactive tool described below has been published as a separate project called goexplorer!

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.

Issues· 73 open

View all issuesOpen on GitHub
  • #213

    feature: Add flag to show function argument types in visualization

    Updated Jul 14, 2026
  • #210

    after call show error module closed with exit_code()

    Updated Nov 26, 2025
  • #196

    zsh: killed go-callvis

    macUpdated Sep 24, 2025
  • #21

    Focus on function instead of package

    enhancementUpdated Sep 8, 2025
  • #78

    Graph from "main" callgraph.Node with depth control

    enhancementUpdated Apr 28, 2025
  • #203

    Sub-module call graph visualization problem.

    Updated Mar 4, 2025
  • #182

    README to explain `<target package>`

    documentationUpdated Feb 11, 2025
  • #205

    warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]

    Updated Feb 11, 2025
  • #96

    Requesting dot format

    questionUpdated Jan 2, 2025
  • #97

    Breaking up large graphs

    questionUpdated Jan 2, 2025

> Tags

Goawesome-gocallgraphgolanggolang-tools

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言