mariotoffia / goasciidoc

Document your go code using asciidoc instead of godoc
Apache License 2.0
18 stars 0 forks source link

not implemented: ArrayType #15

Closed ccremer closed 3 years ago

ccremer commented 3 years ago

Hi. I'm getting an error with Arrays:

type Color string
type Label struct {
    Name        string
    Description string
    color       Color
}
type LabelSet []Label

log:

not-implemented typeSpec.Type.(type) = *ast.ArrayType, ast-dump:
----------------------
     0  *ast.ArrayType {
     1  .  Lbrack: domain/labelset.go:5:15
     2  .  Elt: *ast.Ident {
     3  .  .  NamePos: domain/labelset.go:5:17
     4  .  .  Name: "Label"
     5  .  }
     6  }
----------------------

I'm using latest version v0.4.5

The originating error seems to come from here: https://github.com/mariotoffia/goasciidoc/blob/f5d25e784b2797d40a53acb62c3151c15d1eb596/goparser/internal_parser.go#L152-L163

Would be cool to have this also implemented 😄

mariotoffia commented 3 years ago

Hi @ccremer - Thanks for the bug report!!

I really like that you have outlined the code so I can write a unit test to reproduce it!

I'll have a look and hopefully a fix soon.

Cheers, Mario :)

mariotoffia commented 3 years ago

Hi @ccremer. I've done an update to support ArrayType - please have a go and see so if it works for you?

Cheers, Mario :)

ccremer commented 3 years ago

It works! No more errors and the Array is there. Thanks for the quick fix :) Cheers