bykof / go-plantuml

Generate plantuml diagrams from go source files or directories
MIT License
388 stars 27 forks source link

panic: runtime error: index out of range [-1] #7

Closed enzofoucaud closed 2 years ago

enzofoucaud commented 3 years ago

go-plantuml generate -r panic: runtime error: index out of range [-1]

goroutine 1 [running]: github.com/bykof/go-plantuml/astParser.ParseFile(0xc000018dc8, 0x15, 0x77992c, 0x5, 0xffffffffffffffff) /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/astParser/parser.go:110 +0x91e github.com/bykof/go-plantuml/astParser.ParseDirectory(0xc0001aaa50, 0x7, 0x1, 0xc0001aaa50, 0x7, 0x0) /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/astParser/parser.go:26 +0x465 github.com/bykof/go-plantuml/astParser.ParseDirectory(0xc0001aaa35, 0x3, 0x1, 0xc0001aaa35, 0x3, 0x0) /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/astParser/parser.go:29 +0x2ad github.com/bykof/go-plantuml/astParser.ParseDirectory(0x77902d, 0x1, 0x1, 0x5, 0x4, 0xc000013bc0) /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/astParser/parser.go:29 +0x2ad github.com/bykof/go-plantuml/cmd.glob..func1(0x9ab500, 0xc0000510a0, 0x0, 0x1) /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/cmd/generate.go:28 +0x1dd github.com/spf13/cobra.(Command).execute(0x9ab500, 0xc000051090, 0x1, 0x1, 0x9ab500, 0xc000051090) /home/enzo/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2 github.com/spf13/cobra.(Command).ExecuteC(0x9ab780, 0xc000000180, 0x200000003, 0xc000000180) /home/enzo/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /home/enzo/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/bykof/go-plantuml/cmd.Execute() /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/cmd/root.go:22 +0x31 main.main() /home/enzo/go/pkg/mod/github.com/bykof/go-plantuml@v1.0.0/main.go:6 +0x25