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?
-
2No, there is not. File an issue to give feedback on their decision to change how package documentation should be structured.– Cerise LimónApr 24, 2021 at 17:21
2 Answers
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.md
content.
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.
-
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– IblistoAug 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 usinggo 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– ddrake12Aug 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?– ddrake12Aug 17, 2021 at 16:20 -
1Ahh that seems to have worked! Sorry I probably wasn't thinking right. Thank you!– IblistoAug 27, 2021 at 13:12
Is it possible to hide the README section at all?
No. Unless you omit that file or rename it.