You could use `godoc -html` with existing tools that convert HTML to PDF. e.g., with pandoc:
godoc -html encoding | pandoc -f html -t latex --latex-engine=xelatex - -o encoding.pdf
Or with wkhtmltopdf:
godoc -html encoding | wkhtmltopdf - encoding.pdf
The output isn't perfect and perhaps there are other tools that will do a better job.