MarcGrol / golangAnnotations

Go package that provides annotations for golang to speedup web development
MIT License
345 stars 40 forks source link

Function argument comments are empty #13

Open f0rt opened 2 years ago

f0rt commented 2 years ago

Hey team, I'm using annotationParser.ParseSourceDir() to parse a file into a model. I've noticed that function argument comments (model.Field.DocLines and model.Field.CommentsLines) are always empty. I've done some debugging and saw that ast model function argument comments are empty too. This is a known issue: https://github.com/golang/go/issues/35484 They suggest using ast.NewCommentMap() to load the function argument comments: https://go.dev/play/p/zDcLxXqTk0 Thanks!

MarcGrol commented 2 years ago

Do you have a business driver that forces you to extract function-parameter comments?

f0rt commented 2 years ago

Yes, I'm using the annotations to generate a CLI. I'm copying comments to the CLI parameter comments.

MarcGrol commented 2 years ago

Could you re-apply your proposed change?

Apologies from my side. I should have given this feedback when you offered your PR