gopkgraph

command module
v0.0.0-...-90827c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 7 Imported by: 0

README

gopkgraph

⚠️ This is experimental, performance may be slow.

A simple tool to generate a dependency graph of Golang packages. The output has the same format as the go mod graph command. It can be used alongside tools that support that format such as modgraphviz.

imports dependency tree

Installation

$ go install github.com/jybp/gopkgraph@latest

Usage

List all dependencies of the package in the current directory belonging to the same module:

$ gopkgraph | modgraphviz | dot -Tpng -o pkgs.png

List all dependencies of the package in the current directory including one level of dependencies from other modules belonging to github.com/user:

$ gopkgraph -mods=1 | grep " \github.com/user" | modgraphviz | dot -Tpng -o pkgs.png

Flags

       Flag       Description
-pkg Path to the package. Omit this flag to target the current directory. (optional)
-mods Max depth for packages from other modules. (optional)
-stdlib Max depth for packages from the stdlib. (optional)
-trim Trim module prefix. (optional)
-help Print flags. (optional)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL