Go source files scanner and class diagram PlantUML text generator

only std lib packages, no external dependencies

renderer https://plantuml.com/


puml <path to dir with go files> <path to out.puml>


source code:

package example

type Book struct {
	ID     string `json:"id"`
	Author []Author
	Price  *imported.Price

type Author struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Books []Book

type Showcase struct {
	BookIDs    []string `json:"book_ids"`
	TotalPrice imported.Price

type MobileShowcase struct {

simple clone this repo and run go run main.go ./example ./example/sample.puml

it will generate sample.puml file (even though go code is not valid)


entity Book {
	*ID : string
	*Author : []Author
	Price : imported.Price

entity Author {
	*ID : string
	*Name : string
	*Books : []Book

entity Showcase {
	*BookIDs : []string
	*TotalPrice : imported.Price

entity MobileShowcase {

then, use preferred renderer and it will looks like: result image


View Github