Go to file
filifa 218c05249f go mod tidy 2025-04-05 18:52:24 -04:00
cmd add comments on public methods 2025-04-05 18:51:11 -04:00
.gitignore initial commit 2025-04-05 18:51:08 -04:00
COPYING initial commit 2025-04-05 18:51:08 -04:00
README.md add readme 2025-04-05 18:51:11 -04:00
go.mod go mod tidy 2025-04-05 18:52:24 -04:00
go.sum initial commit 2025-04-05 18:51:08 -04:00
main.go initial commit 2025-04-05 18:51:08 -04:00

README.md

go-type-chains

go-type-chains outputs Graphviz encodings of dependencies between files in a Go package.

Usage

Say you have a Go package in directory foo/. Run

go-type-chains -p foo/

to get a Graphviz encoding where each source file in foo/ is represented by a node, and each edge from A to B indicates that A uses a type or value that is declared in B.

If you import outside packages, use the -i flag to list those packages; otherwise the program will error.

Details

Why?

You may find this useful if you have a package with a lot of autogenerated Go code that you want to organize into subpackages. (This is the original reason I wrote this, although I didn't end up doing any reorganzation on the package I was analyzing. But by the time I decided that, I had written enough code that I thought I should share.)