godepgraph icon indicating copy to clipboard operation
godepgraph copied to clipboard

How to show only the dependencies of one module?

Open guettli opened this issue 1 year ago • 1 comments

Hi Kamil, thank you for that tool!

I want to see the package dependency inside one module.

I want to ignore other dependencies (like stdlib or external packages).

Is there a way to get this?

guettli avatar Aug 06 '24 07:08 guettli

Hey @guettli, this might be a bit late (almost 10 months), but I had the same usecase (I think) and here was my approach:

# Assuming the module is github.com/my/project
# Assuming we have cd-ed into the project
# Assuming the project entrypoint is ./cmd/main.go
godepgraph -s -o github.com/my/project,command-line-arguments cmd/main.go

You need to use the o flag to only show items with a particular prefix. But, you must use the prefix "command-line-arguments" to include your entrypoint.

jbreckmckye avatar Jun 12 '25 15:06 jbreckmckye