golang/gddo

Comments inside func defitions are rendered in the index

zegl opened this issue · 1 comments

zegl commented

Go allows for comments inside the function definition in some cases, like the following example:

func Foo(r interface {
	// Comment about this function
	Bar(string)
})  {
}

One example where this is used is in the go-cmp package.

When the documentation for this package is rendered by gddo, the result is not what I would have expected (live version).

I'll include a screenshot to highlight the issue:

Screen Shot 2019-07-20 at 19 46 31

I would have expected the comments not to be included in the method definition overview, making the end result look like this:

func Reporter(r interface {
  PushStep(PathStep)
  PopStep()
}) Option

This will be resolved in the upcoming Go discovery site, golang/go#33654.