[go: up one dir, main page]

Skip to content
forked from poloxue/modv

go module relationship visualization tool

License

Notifications You must be signed in to change notification settings

DoomConquer/modv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a module dependency visualizer for go mod. It is forked from https://github.com/poloxue/modv, and added some module or package filter function.

Usage

Modv's usage is different in different systems.

Linux

Install graphviz. For Ubuntu/Debian

$ sudo apt-get install graphviz

For ArchLinux

$ sudo pacman -S --needed graphviz

Install modv and use it.

$ go install github.com/DoomConquer/modv
  • the whole module dependency visualizer.
$ go mod graph | modv | dot -T svg -o /tmp/modv.svg && xdg-open /tmp/modv.svg
  • filter part of module dependency visualizer.
$ go mod graph | modv moduleName@version | dot -T svg -o /tmp/modv.svg && xdg-open /tmp/modv.svg
or
$ go mod graph | modv -f moduleName@version | dot -T svg -o /tmp/modv.svg && xdg-open /tmp/modv.svg
  • color part of module dependency visualizer.
$ go mod graph | modv -c moduleName@version | dot -T svg -o /tmp/modv.svg && xdg-open /tmp/modv.svg

MacOS

$ brew install graphviz
$ go get github.com/DoomConquer/modv

Try the following.

cd goProject
$ go mod graph | modv | dot -T png | open -f -a /Applications/Preview.app

If error accured, for eaxmple,FSPathMakeRef(/Applications/Preview.app) failed with error -43.,try the command:

  • the whole module dependency visualizer.
$ go mod graph | modv | dot -T png | open -f -a /System/Applications/Preview.app
  • filter part of module dependency visualizer.
$ go mod graph | modv moduleName@version | dot -T png | open -f -a /System/Applications/Preview.app
or
$ go mod graph | modv -f moduleName@version | dot -T png | open -f -a /System/Applications/Preview.app
  • color part of module dependency visualizer.
$ go mod graph | modv -c moduleName@version | dot -T png | open -f -a /System/Applications/Preview.app

Windows

First, install graphviz:

$ choco install graphviz.portable

For MSYS2

$ pacman -S mingw-w64-x86_64-graphviz

Try it.

$ go get github.com/DoomConquer/modv
  • the whole module dependency visualizer.
$ go mod graph | modv | dot -T svg -o graph.svg; start graph.svg
  • filter part of module dependency visualizer.
$ go mod graph | modv moduleName@version | dot -T svg -o graph.svg; start graph.svg
or
$ go mod graph | modv -f moduleName@version | dot -T svg -o graph.svg; start graph.svg
  • color part of module dependency visualizer.
$ go mod graph | modv -c moduleName@version | dot -T svg -o graph.svg; start graph.svg

Demo

If MacOS, tye the following:

$ git clone https://github.com/poloxue/testmod
$ cd testmod
  1. the whole module dependency visualizer.
$ go mod graph | modv | dot -T png | open -f -a /System/Applications/Preview.app

Output:

  1. filter part of module dependency visualizer.
go mod graph | modv rsc.io/quote/v3@v3.1.0 | dot -T png | open -f -a /System/Applications/Preview.app
or
go mod graph | modv -f rsc.io/quote/v3@v3.1.0 | dot -T png | open -f -a /System/Applications/Preview.app

Output:

  1. color part of module dependency visualizer.
$ go mod graph | modv -c rsc.io/quote/v3@v3.1.0 | dot -T png | open -f -a /System/Applications/Preview.app

Output:

About

go module relationship visualization tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%