Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/google/godepq
https://github.com/google/godepq
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/google/godepq
- Owner: google
- License: mit
- Archived: true
- Created: 2016-07-01T16:18:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-01T21:22:52.000Z (over 5 years ago)
- Last Synced: 2024-06-19T05:45:43.690Z (5 months ago)
- Language: Go
- Size: 1 MB
- Stars: 336
- Watchers: 11
- Forks: 32
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
- my-awesome - google/godepq - 05 star:0.3k fork:0.0k (Go)
README
# godepq
A utility for inspecting go import trees
```
Usage of godepq:
-all-paths=false: whether to include all paths in the result
-from="": root package
-ignore="": regular expression for packages to ignore
-include="": regular expression for packages to include
(excluding packages matching -ignore)
-include-stdlib=false: whether to include go standard library imports
-include-tests=false: whether to include test imports
-o="list": {list: print path(s), dot: export dot graph}
-to="": target package for querying dependency paths
```## Installation:
```
$ go get github.com/google/godepq
```## Examples:
List the packages imported:
```
$ godepq -from github.com/google/godepq
Packages:
github.com/google/godepq
github.com/google/godepq/deps
```Find a path between two packages:
```
$ godepq -from k8s.io/kubernetes/pkg/kubelet -to k8s.io/kubernetes/pkg/master
No path found from "k8s.io/kubernetes/pkg/kubelet" to "k8s.io/kubernetes/pkg/master"$ godepq -from k8s.io/kubernetes/pkg/kubelet -to k8s.io/kubernetes/pkg/credentialprovider
Packages:
k8s.io/kubernetes/pkg/kubelet
k8s.io/kubernetes/pkg/kubelet/dockershim/remote
k8s.io/kubernetes/pkg/kubelet/dockershim
k8s.io/kubernetes/pkg/kubelet/kuberuntime
k8s.io/kubernetes/pkg/credentialprovider
```Track down how a test package is being pulled into a production binary:
```
$ godepq -from k8s.io/kubernetes/cmd/hyperkube -to net/http/httptest -all-paths -o dot | dot -Tpng -o httptest.png
```![example output](example.png)
List imported packages, searching only packages which name starts with "k8s.io/kubernetes":
```
$ godepq -from k8s.io/kubernetes/pkg/kubelet -include="^k8s.io/kubernetes" -show-loc
Packages:
k8s.io/kubernetes/pkg/kubelet (6908)
k8s.io/kubernetes/pkg/kubelet/token (175)
k8s.io/kubernetes/pkg/util/removeall (108)
k8s.io/kubernetes/pkg/kubelet/nodestatus (764)
...
...
Total Lines Of Code: 133943
```*Note: This is not an official Google product.*