Documentation
¶
Overview ¶
Package samples is the compiled twin of the gotth-live documentation.
Every Go and templ block in docs/quickstart.md and docs/guide/*.md is extracted from a file under this directory, and the suite in samples_test.go asserts two things: that each sample package builds, and that every fenced block in the docs still matches the file it claims to come from. The docs therefore cannot rot into code that no longer compiles without a red test.
It is a SEPARATE module, on the precedent of examples/*, for the same reason: nothing a documentation sample reaches for should be able to arrive in a consumer's go.mod. The replace directive in go.mod is what a consumer does not have — it points at the checkout so the samples build against the working tree — and the leading underscore keeps the directory out of the library's own ./... patterns twice over, since a nested module is skipped by the parent anyway.
From inside this module the ordinary patterns work: go build ./..., go vet ./... and go test ./... all see every sample. The suite nonetheless enumerates the packages and builds each by name, because that is what puts the name of the sample that broke in the failure rather than in a wall of compiler output.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apptest is the compiled source for docs/guide/testing-your-app.md: a small application, and the specs that hold it to the library's contracts.
|
Package apptest is the compiled source for docs/guide/testing-your-app.md: a small application, and the specs that hold it to the library's contracts. |
|
Package architecture is the compiled source for docs/guide/architecture.md.
|
Package architecture is the compiled source for docs/guide/architecture.md. |
|
Package deploying is the compiled source for docs/guide/deploying.md.
|
Package deploying is the compiled source for docs/guide/deploying.md. |
|
Package effects is the compiled source for docs/guide/effects-and-server-push.md.
|
Package effects is the compiled source for docs/guide/effects-and-server-push.md. |
|
Package errorhandling is the compiled source for docs/guide/error-handling.md.
|
Package errorhandling is the compiled source for docs/guide/error-handling.md. |
|
Package events is the compiled source for docs/guide/events-and-forms.md.
|
Package events is the compiled source for docs/guide/events-and-forms.md. |
|
Package fragments is the compiled source for docs/guide/fragments-and-dirty-tracking.md.
|
Package fragments is the compiled source for docs/guide/fragments-and-dirty-tracking.md. |
|
Package htmxinterop is the compiled source for docs/guide/htmx-interop.md.
|
Package htmxinterop is the compiled source for docs/guide/htmx-interop.md. |
|
Package keychords is the compiled source for the two modifier-aware options on docs/guide/events-and-forms.md: live.Bind.NoModifiers and live.Bind.PreventDefault.
|
Package keychords is the compiled source for the two modifier-aware options on docs/guide/events-and-forms.md: live.Bind.NoModifiers and live.Bind.PreventDefault. |
|
Package lifecycle is the compiled source for docs/guide/lifecycle-hooks.md.
|
Package lifecycle is the compiled source for docs/guide/lifecycle-hooks.md. |
|
Package mounting is the compiled source for the two things docs/quickstart.md §2 explains beside its router: where the live handler is mounted, and where the first paint's state comes from.
|
Package mounting is the compiled source for the two things docs/quickstart.md §2 explains beside its router: where the live handler is mounted, and where the first paint's state comes from. |
|
Package observability is the compiled source for docs/guide/observability.md.
|
Package observability is the compiled source for docs/guide/observability.md. |
|
Package payments is the compiled source for the idempotency section of docs/guide/effects-and-server-push.md.
|
Package payments is the compiled source for the idempotency section of docs/guide/effects-and-server-push.md. |
|
Command quickstart is the application docs/quickstart.md builds: a number that lives in Go, and a button that changes it.
|
Command quickstart is the application docs/quickstart.md builds: a number that lives in Go, and a button that changes it. |
|
Package security is the compiled source for docs/guide/security.md.
|
Package security is the compiled source for docs/guide/security.md. |