Skip to content

smallnest/gomodv

 
 

Repository files navigation

gomodv

Go Report Card     Go Coverage     Go API Reference

This is a modified version of modgraphviz and forked from lucasepe/modgv.

Converts 'go mod graph' output into GraphViz's DOT language.

  • takes no options or arguments
  • it reads the output generated by “go mod graph” on stdin
  • generates a DOT language and writes to stdout

Usage:

go mod graph | gomodv | dot -Tpng -o graph.png

For each module:

  • the node representing the greatest version (i.e., the version chosen by Go's MVS algorithm) is colored blue.
  • other nodes, which aren't in the final build list, are colored grey

Installation

go get github.com/smallnest/gomodv

Here 👉 https://graphviz.gitlab.io/download/ how to install GraphViz for your OS.

Sample output (PNG)

go mod graph | gomodv | dot -Tpng -o graph2.png

In short mode and not render unpicked:

go mod graph | gomodv -s -unpicked=false| dot -Tpng -o graph.png

Sample output (PDF with clickable links to module docs)

go mod graph | gomodv | dot -Tps2 -o graph.ps
ps2pdf graph.ps graph.pdf

View generated PDF

About

Converts 'go mod graph' output into Graphviz's DOT language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%