Search code examples
gogithubgodoc

Excluding README section from godoc for Github project


I have a Github project with README.md. For the purpose of godoc, I added doc.go file but didn't mean to include the README.md in godoc. Currently the README is showing up as the first section in godoc. Is it possible to hide the README section at all?


Solution

  • I found a good solution for this, simply put your README.md file in a docs folder on Github and it will not show up in the godoc, but still display on Github.

    I did this for my project on Github and you can see the godoc does not show the README.mdcontent.

    EDIT:

    After making the appropriate changes to your github repository, you will need to publish a new patch version to get pkg.go.dev to update with the changes.