Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme: Add examples #5

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,37 @@
[![GoDoc](https://godoc.org/github.com/luno/depgraph?status.png)](https://godoc.org/github.com/luno/depgraph)



DepGraph is a package to figure out an efficient dependency tree for a Go package.

The dependency graph is built by inspecting file imports only, which is faster than `go list`, or ast parsing.
The dependency graph is built by inspecting file imports only, which is faster than `go list`, or AST parsing.

It can be used to figure out why a particular package is imported into a service.

Examples
1. Why is `modulename/currency` imported in `modulename/services/fe`?
```shell
depgraph modulename/services/fe modulename/currency
```
```
modulename/services/fe
└── modulename/locale/allstrings
└── modulename/locale
└── modulename/currency
```

2. Which apps is `modulename/services/withdrawals/ops` imported in?
```shell
depgraph modulename/services/withdrawals/ops
```
```
modulename/services/fe/website/modulename_website
└── modulename/services/fe/website
└── modulename/services/fe/api/base
└── modulename/services/withdrawals/ops/send
└── modulename/services/withdrawals/ops

modulename/services/withdrawals/withdrawals
└── modulename/services/withdrawals/state
└── modulename/services/withdrawals/client/logical
└── modulename/services/withdrawals/ops
```
Loading