Skip to content

Commit

Permalink
readme: Add examples (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
echarrod authored Nov 1, 2024
1 parent 265f5ca commit 554c182
Showing 1 changed file with 30 additions and 2 deletions.
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
```

0 comments on commit 554c182

Please sign in to comment.