jfeliu007 / goplantuml

PlantUML Class Diagram Generator for golang projects
MIT License
1.84k stars 172 forks source link

the example of README.md, output not has compositions relation #160

Closed wdaike closed 1 year ago

wdaike commented 1 year ago
  1. command: goplantuml -show-compositions testingsupport > testingsupport.puml
  2. input go file: package testingsupport

//MyInterface only has one method, notice the signature return value type MyInterface interface { foo() bool }

//MyStruct1 will implement the foo() bool function so it will have an "extends" association with MyInterface type MyStruct1 struct { }

func (s1 *MyStruct1) foo() bool { return true }

//MyStruct2 will be directly composed of MyStruct1 so it will have a composition relationship with it type MyStruct2 struct { MyStruct1 }

//MyStruct3 will have a foo() function but the return value is not a bool, so it will not have any relationship with MyInterface type MyStruct3 struct { Foo MyStruct1 }

func (s3 *MyStruct3) foo() {

}

  1. output:

@startuml namespace testingsupport { interface MyInterface {

"testingsupport.MyInterface" <|-- "testingsupport.MyStruct1"

@enduml

wdaike commented 1 year ago

need -show-aggregations