kisielk / godepgraph

A Go dependency graph visualization tool
MIT License
1.03k stars 92 forks source link

Does not support modules yet #35

Open fgm opened 5 years ago

fgm commented 5 years ago

Although the command will start parsing dependencies, it fails at finding the imports in the modules cache, instead relying only on GOPATH/GOROOT.

schweigert commented 4 years ago

Yes, it does!

godepgraph -nostdlib -horizontal ./cmd/server | dot -Tpng -o godepgraph.png
bwplotka commented 4 years ago

Please update the README! I spent 20m to fight with this tool, until I found this ):

bwplotka commented 4 years ago

Actually it does not support Go modules:

➜  prometheus git:(master) ✗ godepgraph -nostdlib -horizontal ./cmd/prometheus
2020/04/09 12:13:42 failed to import github.com/jpillora/backoff (imported at level 3 by github.com/mwitkow/go-conntrack):
cannot find package "github.com/jpillora/backoff" in any of:
    /home/bwplotka/.gvm/gos/go1.13.1/src/github.com/jpillora/backoff (from $GOROOT)
    /home/bwplotka/Repos/prometheusgopath/src/github.com/jpillora/backoff (from $GOPATH)
go version
go version go1.13.1 **linux/amd64**
/pkg/mod/github.com/kisielk/godepgraph@v0.0.0-20190626013829-57a7e4a651a9/
mvdan commented 3 years ago

For those of you searching "go package graph" and hitting a wall with this tool not supporting modules, you might want to follow https://github.com/Helcaraxan/gomod/issues/71. cc @Helcaraxan

Helcaraxan commented 3 years ago

Just to update after @mvdan's message that github.com/Helcaraxan/gomod now supports querying and visualising both the module and package dependency graphs of a given Go module since the v0.6.0 release that happened earlier today.