I have a private struct (actually more than one, I simplified a bit for this example) which I have a public function on, that satisfies a public interface. This struct is created via a factory method (NewX-style):
package godocprivate
type PublicInterface interface {
PublicFunction()
}
type privatestruct struct {
}
func NewPublic() *privatestruct {
ps := &privatestruct{}
return ps
}
// PublicFunction does something to be documented
func (self *privatestruct) PublicFunction() {
}
I cannot make the factory method return the public interface, because there are other interfaces to be satisfied by the returned value, in my project.
I do want to document PublicFunction() via godoc, but because it is on a private struct, it does not show up:
Is there any way, trick, workaround, etc. to make privatestruct.PublicFunction() visible in Godoc?
My actual use case is even more severe: I do have more than one private struct. All of them satisfy PublicInterface, but the inner workings of their respective PublicFunction-implementations differ, hence could their documentations need to be different, too...