Home Backend Development Golang What is Go Callvis?

What is Go Callvis?

Jan 31, 2023 pm 07:14 PM
golang go language go-callvis

Go-callvis is a golang code visualization tool used to help visualize the call graph of Go programs using interactive views. Install the command "go get -u github.com/ofabry/go-callvis". The purpose of the Go-callvis tool is to provide developers with a visual overview of a Go program, using data from the call graph and its relationship to packages and types.

What is Go Callvis?

The operating environment of this tutorial: Windows 7 system, GO version 1.18, Dell G3 computer.

1. Introduction to go-callvis

Go-callvis is a golang code visualization tool used to help use interactive View visualizes the call graph of a Go program. The purpose of this tool is to provide developers with a visual overview of a Go program, using data from the call graph and its relationship to packages and types. This is especially useful in larger projects where the code complexity is much higher, or when simply trying to understand other people's code.

Features

  • Support specific focus packages in go mod

  • ##Click on a package to quickly switch focus using the interactive viewer
  • Group functions by package and/or method by type
  • Filter packages to a specific import path prefix
  • Ignore functions in the standard library
  • Omit various types of function calls

2. Running dependencies

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

3. Install
go get -u github.com/ofabry/go-callvis
Copy after login
or

git clone https://www.php.cn/link/bb2a2fcd8984d12d9efcfcd75a7f7b38.gitcd go-callvismake install
Copy after login

installed go -callvis executable file will be in the $GOPATH/bin directory

4. How to use

Run
    go- callvis -h
  • can list all supported options, as follows
    Usage of go-callvis:
      -debug
        	Enable verbose log.
        	输出详细日志
      -file string
        	output filename - omit to use server mode
        	以文件新式输出结果,并将忽略server交互模式
      -cacheDir string
        	Enable caching to avoid unnecessary re-rendering.
        	启用缓存以避免不必要的重新渲染。
      -focus string
        	Focus specific package using name or import path. (default "main")
        	关注特定的程序包,默认为“main”包
      -format string
        	output file format [svg | png | jpg | ...] (default "svg")
        	输出文件的格式,[svg | png | jpg | ...],默认为svg
      -graphviz
        	Use Graphviz's dot program to render images.
        	使用Graphviz渲染图像
      -group string
        	Grouping functions by packages and/or types [pkg, type] (separated by comma) (default "pkg")
        	分组功能,根据包 与/或 类型分组 [pkg, type] (用逗号分开) (默认 "pkg"),例如 -group pkg,type
      -http string
        	HTTP service address. (default ":7878")
            HTTP 服务地址 (默认 ":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)
            最小边长(用于更宽的输出)。 (默认2)
      -nodesep float
        	Minimum space between two adjacent nodes in the same rank (for taller output). (default 0.35)
            同一等级中两个相邻节点之间的最小间距(用于更高的输出)。 (默认0.35)
      -nointer
        	Omit calls to unexported functions.
        	忽略对未导出函数的调用。(忽略首字母小写的函数)
      -nostd
        	Omit calls to/from packages in standard library.
            忽略标准库的调用
      -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
            在构建期间更适合的构建标记
            有关构建标记的更多信息,请参阅go / build软件包的文档中的构建约束说明。
      -tests
        	Include test code.
            包含测试代码
      -version
        	Show version and exit.
            显示版本号
    Copy after login
Command line format:
    go-callvis [optional parameters]
  • By default, the output image is at
  • http://localhost:7878/
  • , which can be changed using the option -http="ADDR:PORT" HTTP server address. Static output:
  • To generate a single output file, use option
      -file=
    • to select the output file target. The output format defaults to svg, use the option
    • -format=
    • to select other output formats.
    Usage example:
  • Resolve main package
      go-callvis -skipbrowser -nostd ./
    • Resolve testPkg package
    • go-callvis -group pkg,type -focus testPkg github.com/Project specific path

##5. Rendering Description

What is Go Callvis?Specification Description

[Related recommendations: What is Go Callvis?Go Video tutorial

Programming teaching

The above is the detailed content of What is Go Callvis?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1669
14
PHP Tutorial
1273
29
C# Tutorial
1256
24
How to solve the user_id type conversion problem when using Redis Stream to implement message queues in Go language? How to solve the user_id type conversion problem when using Redis Stream to implement message queues in Go language? Apr 02, 2025 pm 04:54 PM

The problem of using RedisStream to implement message queues in Go language is using Go language and Redis...

What should I do if the custom structure labels in GoLand are not displayed? What should I do if the custom structure labels in GoLand are not displayed? Apr 02, 2025 pm 05:09 PM

What should I do if the custom structure labels in GoLand are not displayed? When using GoLand for Go language development, many developers will encounter custom structure tags...

Golang's Purpose: Building Efficient and Scalable Systems Golang's Purpose: Building Efficient and Scalable Systems Apr 09, 2025 pm 05:17 PM

Go language performs well in building efficient and scalable systems. Its advantages include: 1. High performance: compiled into machine code, fast running speed; 2. Concurrent programming: simplify multitasking through goroutines and channels; 3. Simplicity: concise syntax, reducing learning and maintenance costs; 4. Cross-platform: supports cross-platform compilation, easy deployment.

Which libraries in Go are developed by large companies or provided by well-known open source projects? Which libraries in Go are developed by large companies or provided by well-known open source projects? Apr 02, 2025 pm 04:12 PM

Which libraries in Go are developed by large companies or well-known open source projects? When programming in Go, developers often encounter some common needs, ...

In Go programming, how to correctly manage the connection and release resources between Mysql and Redis? In Go programming, how to correctly manage the connection and release resources between Mysql and Redis? Apr 02, 2025 pm 05:03 PM

Resource management in Go programming: Mysql and Redis connect and release in learning how to correctly manage resources, especially with databases and caches...

Do I need to install an Oracle client when connecting to an Oracle database using Go? Do I need to install an Oracle client when connecting to an Oracle database using Go? Apr 02, 2025 pm 03:48 PM

Do I need to install an Oracle client when connecting to an Oracle database using Go? When developing in Go, connecting to Oracle databases is a common requirement...

How to ensure concurrency is safe and efficient when writing multi-process logs? How to ensure concurrency is safe and efficient when writing multi-process logs? Apr 02, 2025 pm 03:51 PM

Efficiently handle concurrency security issues in multi-process log writing. Multiple processes write the same log file at the same time. How to ensure concurrency is safe and efficient? This is a...

Golang vs. Python: Performance and Scalability Golang vs. Python: Performance and Scalability Apr 19, 2025 am 12:18 AM

Golang is better than Python in terms of performance and scalability. 1) Golang's compilation-type characteristics and efficient concurrency model make it perform well in high concurrency scenarios. 2) Python, as an interpreted language, executes slowly, but can optimize performance through tools such as Cython.

See all articles