https://github.com/tmr232/go-overview-graph
Generate IDA Pro-style graph overviews for Go functions
https://github.com/tmr232/go-overview-graph
code-visualization golang
Last synced: 2 months ago
JSON representation
Generate IDA Pro-style graph overviews for Go functions
- Host: GitHub
- URL: https://github.com/tmr232/go-overview-graph
- Owner: tmr232
- License: mit
- Created: 2022-11-12T15:41:17.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-16T17:35:06.000Z (about 3 years ago)
- Last Synced: 2025-02-14T13:13:44.756Z (10 months ago)
- Topics: code-visualization, golang
- Language: Go
- Homepage: https://tmr232.github.io/go-overview-graph/
- Size: 3.01 MB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-overview-graph
A tool for displaying graph overviews of Go functions.
This is very early work-in-progress!!!
## Example
```go
// File: demo/demo.go
func Demo(flag bool, n int) {
if flag {
fmt.Println("Hello, World!")
}
fmt.Println("Oh no!")
for _, x := range "Hello, World!" {
fmt.Println(x)
}
if flag {
fmt.Println("A")
} else if n == 3 {
fmt.Println("B")
} else if n == 2 {
fmt.Println("C")
} else {
fmt.Println("D")
}
switch n {
case 1:
return
case 2:
return
case 3:
return
}
fmt.Println("Yo")
}
```
Run the tool:
```bash
go run . function --pkg ./demo --function Demo | dot -Tpng -o"media/demo.png"
```
And we get:

## Side By Side
Run:
```bash
mkdir sxs
go run . sxs --pkg ./demo --out ./sxs
```
And we get:
