# Documenting a Go package with Hugo

**URL:** <https://discourse.gohugo.io/t/documenting-a-go-package-with-hugo/88>\
**Category:** support\
**Created:** [September 22, 2014, 8:23pm UTC](https://discourse.gohugo.io/t/documenting-a-go-package-with-hugo/88 "2014-09-22T20:23:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natefinch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/natefinch/32/2136_2.png) [@natefinch](https://discourse.gohugo.io/u/natefinch)\
**Post date:** [September 22, 2014, 8:23pm UTC](https://discourse.gohugo.io/t/documenting-a-go-package-with-hugo/88/1 "2014-09-22T20:23:39Z")

</div>

from [Documenting a Go package with Hugo. · Issue #517 · gohugoio/hugo · GitHub](https://github.com/spf13/hugo/issues/517)

> Is there a theme, guide, etc for integrating Go documentation with a Hugo project?

So, I do something like that here: [npf.io/lumberjack.v2](http://npf.io/lumberjack.v2)

I first use [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) to convert the godoc for the package into markdown, then I manaully massage the markdown… with a [template](https://github.com/natefinch/npf/blob/master/layouts/code/single.html) and some [metadata](https://github.com/natefinch/npf/blob/master/content/code/lumberjack.v2.md) specific to my site.

The massage is necessary because godoc2md isn’t perfect. One big hole is that it leaves out the example functions, which I use fairly extensively… so I often will go copy and paste those from [godoc.org](http://godoc.org) for my package and manually insert them into the markdown.

I added support for badges, since I like showing that my stuff is getting tested etc, and that falls outside of the godoc, but I feel it’s important.
