Git Product home page Git Product logo

godepgraph's Introduction

godepgraph

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

Build Status

Install

go get github.com/kisielk/godepgraph

Use

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

godepgraph github.com/kisielk/godepgraph

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

godepgraph's People

Contributors

kisielk avatar 13rac1 avatar paulbuis avatar aviau avatar starius avatar cespare avatar danehammer avatar davcamer avatar dominikh avatar igrmk avatar calmh avatar justin-w avatar moul avatar radeksimko avatar kveselkov avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.