forked from qquunn/go-package-plantuml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.go
38 lines (27 loc) · 838 Bytes
/
demo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"git.oschina.net/jscode/go-package-plantuml/codeanalysis"
log "github.com/sirupsen/logrus"
"fmt"
"io/ioutil"
)
func main() {
log.SetLevel(log.InfoLevel)
//config := codeanalysis.Config{
// CodeDir: "/appdev/go-demo/src/git.oschina.net/jscode/go-package-plantuml/testdata/a",
// GopathDir : "/appdev/go-demo",
//}
//
//result := codeanalysis.AnalysisCode(config)
//
//result.OutputToFile("/tmp/uml.txt")
config := codeanalysis.Config{
CodeDir: "/appdev/go-demo/src/git.oschina.net/jscode/go-package-plantuml/testdata/uml",
GopathDir : "/appdev/go-demo",
}
result := codeanalysis.AnalysisCode(config)
result.OutputToFile("/tmp/uml.txt")
bytes, _ := ioutil.ReadFile("/tmp/uml.txt")
fmt.Println(string(bytes))
// java -jar /app/plantuml.jar /tmp/uml.txt -tsvg && open2 /tmp/uml.svg
}