Can't godoc create documentation for packages within internal folder?

1.6k Views Asked by At

In a common project structure there are folders like:

/cmd

/internal

/pkg

however when executing godoc

No documentation is created for the packages within the internal folder: internal is missing between cmd and pkg

Problem is: there are functions within the package and they need to be documented even for internal usage. Is there any way?

1

There are 1 best solutions below

2
IhtkaS On BEST ANSWER

For instance, https://golang.org/pkg/math/big/?m=all shows the documentation for all (not just the exported) declarations of package big.

As mentioned in this documentation, using m=all parameter in URL will list internal packages. One caveat is that it includes all declarations including unexported declarations.