Open zegl opened 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.
go-cmp
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:
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.
Go allows for comments inside the function definition in some cases, like the following example:
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:
I would have expected the comments not to be included in the method definition overview, making the end result look like this: