How to create dependency graph of Go packages

A great tool for visualizing the dependencies between Go packages is godepgraph. This can output the dependency graph for packages in a Go package in GraphViz format. This can be viewed easily using XDot or saved into various image formats.

  • To install:
$ go get
  • Invoke from any place on a Go package stored in $GOPATH/src:
$ godepgraph >
  • If the packages from the Go standard library are not excluded the graph can be very messy. To exclude them use the -s option.

Tried with: Go 1.6.2 and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.