~adnano/adnano.co

2cdcf005e5ca9fc38aa4e86cf73fcb23be85b804 — Adnan Maolood 24 days ago 6918ed8 master
Reading Go documentation with gddo
3 files changed, 42 insertions(+), 0 deletions(-)

A content/2022-07-16-gddo.md
A static/media/2022-07-16-gddo.png
M static/style.css
A content/2022-07-16-gddo.md => content/2022-07-16-gddo.md +38 -0
@@ 0,0 1,38 @@
---
title: Reading Go documentation with gddo
---

Today, I am pleased to announce the release of version 1.6 of [gddo], the
software powering [godocs.io]. For those unaware, gddo is a maintained fork of
the software which powered the now-defunct godoc.org. It runs as a web server
and serves documentation for Go packages.

This release focuses on improving the local documentation viewing experience.
gddo now supports serving documentation for modules in the current directory,
allowing you to preview documentation while making changes locally. This makes
gddo a good replacement for the now-deprecated [godoc] tool, and a lightweight
alternative to the [pkgsite] command.

[gddo]: https://git.sr.ht/~sircmpwn/gddo
[godocs.io]: https://godocs.io
[godoc]: https://godocs.io/golang.org/x/tools/cmd/godoc
[pkgsite]: https://godocs.io/golang.org/x/pkgsite/cmd/pkgsite

To view documentation locally, simply run:

```sh
cd my-module
gddo --http :8080
```

Then navigate your web browser to <http://localhost:8080> to view the
documentation for your module.

![Screenshot of gddo being used to view its own documentation](/media/2022-07-16-gddo.png)

gddo will also serve documentation for your local copy of the standard library,
as well as any modules you have downloaded in your Go module cache, allowing you
to easily view the documentation for your dependencies.

gddo is still not a complete replacement for the godoc tool. If you are missing
a feature from godoc and want to implement it for gddo, patches are welcome!

A static/media/2022-07-16-gddo.png => static/media/2022-07-16-gddo.png +0 -0
M static/style.css => static/style.css +4 -0
@@ 65,6 65,10 @@ pre {
	background-color: var(--pre);
}

img {
	max-width: 100%;
}

footer {
	margin-top: 2rem;
}