• Stars
    star
    1,028
  • Rank 44,809 (Top 0.9 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 12 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Go dependency graph visualization tool

godepgraph

godepgraph is a program for generating a dependency graph of Go packages.

Build Status

Install

go install github.com/kisielk/godepgraph@latest

Use

For basic usage, just give the package path of interest as the first argument:

godepgraph github.com/kisielk/godepgraph

If you intent to graph a go mod project, your package should be passed as a relative path:

godepgraph ./pkg/api

The output is a graph in Graphviz dot format. If you have the graphviz tools installed you can render it by piping the output to dot:

godepgraph github.com/kisielk/godepgraph | dot -Tpng -o godepgraph.png

By default godepgraph will display packages in the standard library in the graph, though it will not delve in to their dependencies.

Colors

godepgraph uses a simple color scheme to denote different types of packages:

  • green: a package that is part of the Go standard library, installed in $GOROOT.
  • blue: a regular Go package found in $GOPATH.
  • yellow: a vendored Go package found in $GOPATH.
  • orange: a package found in $GOPATH that uses cgo by importing the special package "C".

Ignoring Imports

The Go Standard Library

If you want to ignore standard library packages entirely, use the -s flag:

godepgraph -s github.com/kisielk/godepgraph

Vendored Libraries

If you want to ignore vendored packages entirely, use the -novendor flag:

godepgraph -novendor github.com/something/else

By Name

Import paths can be ignored in a comma-separated list passed to the -i flag:

godepgraph -i github.com/foo/bar,github.com/baz/blah github.com/something/else

The packages and their imports will be excluded from the graph, unless the imports are also imported by another package which is not excluded.

By Prefix

Import paths can also be ignored by prefix. The -p flag takes a comma-separated list of prefixes:

godepgraph -p github.com,launchpad.net bitbucket.org/foo/bar

Example

Here's some example output for a component of Gary Burd's gopkgdoc project:

Example output

More Repositories

1

errcheck

errcheck checks that you checked errors.
Go
2,329
star
2

sqlstruct

sqlstruct provides some convenience functions for using structs with go's database/sql package
Go
173
star
3

vigo

Vi in Go
Go
168
star
4

gostatsd

An implementation of Etsy's statsd in Go
91
star
5

raven-go

raven-go is a Go client for Sentry
Go
64
star
6

gotool

A library of some of the utility functions provided by (but not exported) by cmd/go
Go
62
star
7

og-rek

ogΓ³rek is a Go library for encoding and decoding pickles.
Go
61
star
8

whisper-go

A golang library for whisper databases
Go
40
star
9

vendorize

vendorize is a tool for vendorizing go imports, including transitive dependencies
Go
20
star
10

goflamegraph

FlameGraphs for Go
Go
17
star
11

covenant

Code contracts for Python 3
Python
17
star
12

takingoutthetrash

Taking Out the Trash - Optimizing Memory Allocation in Go Programs. A talk from the Feb 3, 2015 Golang Vancouver meetup.
11
star
13

mutator

Performs mutations on Go code
Go
10
star
14

jsonrpc-example

Example of using Go's JSON-RPC from other languages.
Go
8
star
15

gorge

gorge is a Go library for interacting with GridEngine
Go
8
star
16

passpersist

A library for writing Net-SNMP pass_persist commands
Python
7
star
17

cmd

A package for creating line-oriented interactive interpreters
Go
5
star
18

goxmind

A Go library for working with XMind files.
Go
5
star
19

bigset

Package bigset implements a set type for storing non-negative integers using the Go standard library's math/big package.
Go
4
star
20

monome

Go library for Monome
Go
3
star
21

dotvim

My Vim configuration.
Vim Script
3
star
22

build-web-application-with-golang_EN

This is an English version of γ€ŠGo Web编程》, which original version was written by AstaXie and translated by Unknown.
2
star
23

gojunit

JUnit XML formatter for Go test output
Go
2
star
24

goversiontags

A demonstration of go version tags
Go
2
star
25

robota

JavaScript
1
star
26

spirytus

spirytus rektyfikowany
Go
1
star
27

gosrc

gosrc.org
Go
1
star
28

latexmath2png

Automatically exported from code.google.com/p/latexmath2png
Python
1
star
29

shapeshifter

Go
1
star
30

set

set is a Go library for working with finite sets
Go
1
star
31

flagcxx

A header-only flag parsing library for C++17 and above, inspired by the Go flag package.
C++
1
star