Godoc, create html for entire package

匆匆过客 提交于 2019-12-04 01:48:22

问题


How can I use godoc to create html documentation for an entire package. i.e. recursively. At the moment when I run:

godoc -html -goroot="mypath" pkg > index.html

I just get an index.html that contains information on the .go files in the current directory.

There is no documentation for the other sub packages but the index.html does include dead links for them.

How can I run the above command in a recursive fashion? Perhaps I am missing something because there is no mention of recursion in the godoc documentation.


回答1:


Go has no notion of "sub packages" in reality - all packages are just packages, as you can tell by the package declaration at the top of the file not having any hierarchy. It would be unidiomatic to package all documentation for nested subdirectories into a single file - as the subdirectories contain different packages, the documentation should be separate.



来源:https://stackoverflow.com/questions/38331224/godoc-create-html-for-entire-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!