Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

go

godoc

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?

like image 894
claus Avatar asked Oct 24 '25 05:10

claus


1 Answers

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.

like image 113
IhtkaS Avatar answered Oct 26 '25 19:10

IhtkaS