kazukousen / gouml Goto Github PK
View Code? Open in Web Editor NEWAutomatically generate PlantUML from Go Code.
License: MIT License
Automatically generate PlantUML from Go Code.
License: MIT License
I am trying to install gouml, but get this error.
go get -u github.com/kazukousen/gouml/cmd/gouml
# github.com/kazukousen/gouml/cmd/gouml
../../../github.com/kazukousen/gouml/cmd/gouml/main.go:17:22: cannot use cli.StringSliceFlag literal (type cli.StringSliceFlag) as type cli.Flag in array or slice literal:
cli.StringSliceFlag does not implement cli.Flag (Apply method has pointer receiver)
../../../github.com/kazukousen/gouml/cmd/gouml/main.go:21:22: cannot use cli.StringSliceFlag literal (type cli.StringSliceFlag) as type cli.Flag in array or slice literal:
cli.StringSliceFlag does not implement cli.Flag (Apply method has pointer receiver)
../../../github.com/kazukousen/gouml/cmd/gouml/main.go:25:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
../../../github.com/kazukousen/gouml/cmd/gouml/main.go:33:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
../../../github.com/kazukousen/gouml/cmd/gouml/main.go:58:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
Using gouml?
Let's us know in the comments!
package foo
type Foo string
func (Foo) Use() bool {
bar.Bar(5)
}
package bar
type Bar int
converted
class "Foo" as f <<V>> {
}
class "Bar" as b <<V>> {
}
f : Use() : bool
f ..> b : <<use>>
type Foo interface {
GetBar() Bar
}
type Bar string
interface "Foo" as f {
}
class "Bar" as b <<V,orchid>> {
}
f : GetBar() : Bar
f ..> b : <<use>>
Not sure how feasible this is, but would also be nice to be able to generate a sequence diagram/s... Just an idea. :)
Let me say first that this is a freaking awesome tool.
I let it loose on a complicated model, it took 5 minutes but did a stellar job. Of course, since the
model was so complicated, it generated something really complex as well.
When navigating large graphs, it would be useful to offer the following filters.
<<return>>
relationships<<use>>
relationshipstype FooCollection []Foo
type Foo string
class "FooCollection" as fc {
}
class "Foo" as f {
}
fc *-- f
I am trying to install gouml, but got this error.
go get -u github.com/kazukousen/gouml/cmd/gouml
# github.com/kazukousen/gouml/cmd/gouml
../../../go/src/github.com/kazukousen/gouml/cmd/gouml/main.go:37:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
Also be great to be able to pass in list of directories that also need to be ignored too.
I'm using this on a project that has a number of support tools build in ./cmd/* that I dont want to generate the uml for as they aren't part of the primary business domain I need the uml for.
Thanks.
Currently, Note
only support const identifier.
type Kind string
// enum of kind
const (
KindFoo Kind = "foo"
KindBar Kind = "bar"
)
class "Kind" as k <<V>>
note as nk
<b>enum of kind</b>
KindFoo
KindBar
end note
nk --> k
type FooFunc func(now time.Time) bool
steps to reproduce:
go get -u github.com/kazukousen/gouml/cmd/gouml
expected outcome:
gouml --version
gouml version 0.2
actual outcome:
# github.com/kazukousen/gouml/internal/gouml/plantuml
../github.com/kazukousen/gouml/internal/gouml/plantuml/parser.go:33:62: elapsed.Milliseconds undefined (type time.Duration has no field or method Milliseconds)
../github.com/kazukousen/gouml/internal/gouml/plantuml/parser.go:71:66: elapsed.Milliseconds undefined (type time.Duration has no field or method Milliseconds)
I would like to convert the code below.
package foo
type foo struct{
id int `json:"id"`
bar struct{
id int `json:"bar_id"`
} `json:"bar"`
}
However, the output contains struct tag data.
package "foo" {
class "foo" as foo.foo <<V,Orchid>> {
-id: int
-bar: struct{id int "json:\"bar_id\""}
}
}
I think this is because that types.Struct
has not only field data, but also tag data like,
&types.Struct{
fields:[]*types.Var{(*types.Var)(0xc0000ee3c0)},
tags:[]string{"json:\"bar_id\""}
}
Therefore, when we use types.Struct.String()
, unnecessary information is showed.
go/src/github.com/kazukousen/gouml/cmd/gouml/main.go:37:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
First of all, awesome tool for reverse engineering. Wonderful work!
Let me illustrate this issue with an example:
Let's say I have a package called usecases
with an interface called UserOutputBoundary
and another package called adapters
with a type UserPresenter
that implements the interface.
Here is an example where everything works great using a simple data type in the interface methods:
However, if I use a UserOutputData
type from the usecases
package instead of a simple data type this tool gets confused and produces the following PlantUML output without the expected inheritance relationship:
Hope it's an easy fix.
From what I understand the StringSliceFlag allows multiple files to be initialized
gouml --file somedirectory/ --file someotherdirectory/
Currently the help documentation for gouml init
does not make this behavior clear:
--file value, -f value File or Directory you want to parse
Just giving this tool a spin and its taking forever to parse some of my *_test.go files. Be great if these could be ignored either by a cli flag or even by default.
Just noticed that my plantuml plugin in Goland has issues rendering the image output when the header and footer @startuml @enduml aren't included in the outputted file. I add these manually and its all good.
I'm also guessing this could be an issue for other third party tools that rely on this markup in someway.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.