https://github.com/hiroakis/goflow
A flowchart generator for Go
https://github.com/hiroakis/goflow
Last synced: 4 months ago
JSON representation
A flowchart generator for Go
- Host: GitHub
- URL: https://github.com/hiroakis/goflow
- Owner: hiroakis
- License: mit
- Created: 2024-09-10T12:30:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-10T12:46:32.000Z (almost 2 years ago)
- Last Synced: 2025-10-05T22:43:39.338Z (9 months ago)
- Language: Go
- Size: 130 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goflow
`goflow`, a flowchart generator for Go.
# Usage
```
goflow
```
## Example
```
goflow testdata/src/example/example.go f5
```
```uml
@startuml
start
:f5;
if (arg == 0) then (yes)
:fmt.Printf("if %d\n", arg);
else
if (arg == 1) then (yes)
:fmt.Printf("else if %d\n", arg);
else
:fmt.Printf("else %d\n", arg);
endif
endif
switch (arg % 2)
case (1)
:odd = true;
case (0)
:even = true;
:return ;
end
case (default)
:err = fmt.Errorf("error: %d", arg);
:return ;
end
endswitch
switch ()
case (args == 10)
:err = fmt.Errorf("error: %d", arg);
:return ;
end
case (args == 20)
:err = fmt.Errorf("error: %d", arg);
:return ;
end
case ()
endswitch
while (for i := 0; i < 10; i++)
if (i == 5) then (yes)
:continue;
stop
endif
:return switchCase(i);
end
endwhile
:c int;
while (for)
:c++;
if (c > 10) then (yes)
:break;
break
endif
endwhile
:return ;
end
@enduml
```

# TODO
- go routine
- channel
- select statement
- ... and more
# License
MIT