1

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?

1
  • 2
    No, there is not. File an issue to give feedback on their decision to change how package documentation should be structured. Apr 24, 2021 at 17:21

2 Answers 2

3

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.

4
  • I could've sworn it did as you said, but for some reason now the README's showing up on godoc again: github.com/sanggonlee/pogo
    – Iblisto
    Aug 14, 2021 at 13:22
  • @Iblisto you probably just need to force pkg.go.dev to update. I think I've done this in the past using go get but if you look here apparently you can hit a URL as well: github.com/golang/go/issues/38848. Let me know if this works and I will update my answer with this information
    – ddrake12
    Aug 15, 2021 at 16:23
  • @Iblisto I had some time and tried playing around with this but couldn't get it to update on pkg.go.dev using any method. You may need to publish a patch version (v1.0.1) to get it to update. Can you try that?
    – ddrake12
    Aug 17, 2021 at 16:20
  • 1
    Ahh that seems to have worked! Sorry I probably wasn't thinking right. Thank you!
    – Iblisto
    Aug 27, 2021 at 13:12
1

Is it possible to hide the README section at all?

No. Unless you omit that file or rename it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.