---
title: 'Go doc'
url: 'https://wiki.teletypegames.org/development/godoc'
markdown: 'https://wiki.teletypegames.org/development/godoc.md'
lang: en
date: '2026-10-31'
description: 'Our Go modules keep their manual and their reference in the source: the package comments explain how the pieces fit, the doc comments every exported identifier. Each release tag publishes the HTML built from them under /godoc/. The table below always shows the newest published version. The Ruby ge…'
taxonomy:
  tag:
    - howto
---

# Go doc

> Our Go modules keep their manual and their reference in the source: the package comments explain how the pieces fit, the doc comments every exported identifier. Each release tag publishes the HTML built from them under [/godoc/](https://wiki.teletypegames.org/godoc/index.json). The table below always shows the newest published version. The Ruby gems do the same with [RDoc](https://wiki.teletypegames.org/development/rdoc).

# Published modules

[/godoc/index.json](https://wiki.teletypegames.org/godoc/index.json)

| Module | Engine page | Release tag |
|---|---|---|
| `inkwell` | [Inkwell](https://wiki.teletypegames.org/engines/inkwell) | `vX.Y.Z` in engines/inkwell |

Each module keeps its ten newest versions; `/godoc/inkwell/latest/` always points at the newest, and the version switcher at the top of every page moves between them.

# The rule: everything documented

The module's `CLAUDE.md` says it and CI enforces it: a push fails if `revive` (the `exported` rule, `revive.toml` in the repo) finds an exported type, function, method, constant or variable without a doc comment.

- The comment starts with the identifier's name and says what it does, what it takes and returns, the errors and the state it changes. The reason for a change goes in the commit, not the comment.
- Go doc syntax, not Markdown: `[Name]` and `[pkg.Name]` links, `# Heading` sections in package comments, lists with `-`, code as an indented block.
- Every package has its package comment in `doc.go`; the manual — how to build a game, with examples — lives there. The `README.md` only links here.

# How it gets here

1. A release tag runs the module's pipeline: build, vet, the documentation gate, then `doc2go` builds the HTML and a `meta.json` (version, commit, date).
2. The pipeline uploads `godoc.tar.gz` as a Gitea generic package in the engines org, named after the module with a `-godoc` suffix.
3. The Gitea package webhook calls the wiki-fetcher, which also looks every ten minutes. It unpacks the new version, gives it the wiki look, moves `latest` and rewrites `/godoc/index.json`.
4. The table above reads that index in the browser, and the engine pages link to `latest`, so a release needs no wiki edit.

If a round fails, the wiki-fetcher's `/health` turns red. Details: `fetcher/README.md` in services/wiki-pages.

'; var prevLevel = 2; for (var i = 0; i < headings.length; i++) { var h = headings\[i\]; var text = h.textContent.trim(); var slug = text.toLowerCase() .replace(/\[áàâä\]/g,'a').replace(/\[éèêë\]/g,'e').replace(/\[íìîï\]/g,'i') .replace(/\[óòôöő\]/g,'o').replace(/\[úùûüű\]/g,'u') .replace(/\[^a-z0-9\]+/g, '-').replace(/^-|-$/g, ''); if (!slug) slug = 'heading-' + i; if (used\[slug\]) { slug += '-' + i; } used\[slug\] = true; h.id = slug; var level = parseInt(h.tagName.charAt(1)); var cls = level > 2 ? ' class="toc-child"' : ''; html += '- [' + text + '](#'%20+%20slug%20+%20')
'; } html += '
'; toc.innerHTML = html; // Scroll-spy: highlight current heading var links = toc.querySelectorAll('a'); var ids = \[\]; for (var j = 0; j < links.length; j++) ids.push(links\[j\].getAttribute('href').slice(1)); function updateActive() { var current = ''; for (var k = 0; k < ids.length; k++) { var el = document.getElementById(ids\[k\]); if (el && el.getBoundingClientRect().top <= 80) current = ids\[k\]; } for (var m = 0; m < links.length; m++) { links\[m\].parentNode.classList.toggle('active', links\[m\].getAttribute('href') === '#' + current); } } window.addEventListener('scroll', updateActive, { passive: true }); updateActive(); })();

---

## Navigation

- Parent: [Development](https://wiki.teletypegames.org/development.md)
- Next: [LibreSprite](https://wiki.teletypegames.org/development/libresprite.md)
