The godep
command parses the Go module in the current directory using the standard library's go/ast
package. It builds a package dependency graph for the Graphviz dot
command that produces a SVG file for display.
The godep
command depends on Graphviz. To download and install Graphviz, select a stable release, download its tar file, build, and install.
tar xzvf =(curl -L "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/7.1.0/graphviz-7.1.0.tar.gz")
cd graphviz-7.1.0
./configure
make
sudo make install
With the dot
command in place, download and install Godep:
go install github.com/zosmac/godep@latest
The godep
command takes no arguments. Set the current directory to that for a Go language module, defined by a go.mod
file. Direct the standard output to a SVG file and open in a browser.
() {
godep >$1
mv $1 $1.svg
open $1.svg
sleep 1
rm $1.svg
} `mktemp /tmp/XXXXXX`
Copyright © 2023 The Gomon Project.