2

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?

claus
  • 56
  • 6

1 Answers1

4

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.

IhtkaS
  • 1,314
  • 3
  • 15
  • 31
  • One trick is to include m=all to list internal package and navigate to the internal package. then you can remove the m=all flag to list only exported declarations in the internal package. – IhtkaS Apr 21 '21 at 05:45
  • Thank both of you. It works. I actually think the could have offered a cli flag for this functionality. This way it's a little obfuscated. There is also `go doc -all` so ... – claus Apr 21 '21 at 06:28