Help us shape the future of Go! Take the 2026 Go Developer Survey

docsnippets

command
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Command docsnippets checks that code blocks in docs/site that claim to be copied from an example match that region exactly. A claim is a paragraph right after the block that starts with "(Copied from [`examples/x`](…), region `name`.)" or, for a file already named on the page, "(Region `name`.)". The example is examples/x/main.go, or the file itself when the link names a .go or .templ file (examples/x/migrations.go). First-party plugins are examples too: plugins/x/plugin.go. Go and templ code blocks are checked. Indentation common to every line, and blank lines at the start and end, are ignored on both sides, so a region inside a function body can be shown unindented, and one in a package can start with a blank line that keeps "// region" out of the next declaration's doc comment. See docs/contributing/documentation-guide.md §7. Run it with `make docs-check`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL