Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yqylovy/goimportdot
A tiny tool to draw a graph of golang package import relationship
https://github.com/yqylovy/goimportdot
dot golang graph
Last synced: 3 months ago
JSON representation
A tiny tool to draw a graph of golang package import relationship
- Host: GitHub
- URL: https://github.com/yqylovy/goimportdot
- Owner: yqylovy
- Created: 2017-05-15T17:54:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-30T11:14:49.000Z (about 6 years ago)
- Last Synced: 2024-07-16T13:08:55.345Z (4 months ago)
- Topics: dot, golang, graph
- Language: Go
- Size: 408 KB
- Stars: 137
- Watchers: 9
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GoImportDot
## What is GoImportDot ?
GoImportDot is a tiny tool to generate a `dot` file (used for Graphviz) of imports of golang package.It has two purpose.
* Help people quickly understand how a package organization without going into details of code.
* Help people find out whether a package is too confusing and needs to be refactored.## Quick Start
```
go get -u github.com/yqylovy/goimportdot
goimportdot -pkg=yourpackagename > pkg.dot
dot -Tsvg pkg.dot >pkg.svg
```## Example
Install `go.uber.org/zap`
```
go get go.uber.org/zap
```Get a graph of `go.uber.org/zap`
```
goimportdot -pkg=go.uber.org/zap > zap.dot
dot -Tpng zap.dot > zap.png
```![zap](./docs/zap.png)
Only get a graph of zapcore in `go.uber.org/zap`
```
goimportdot -pkg=go.uber.org/zap -root=go.uber.org/zap/zapcore > zapcore.dot
dot -Tpng zapcore.dot > zapcore.png
```![zap](./docs/zapcore.png)