golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 265 forks source link

Comments inside func defitions are rendered in the index #633

Open zegl opened 5 years ago

zegl commented 5 years ago

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
dmitshur commented 4 years ago

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