text/template: data-driven textual output in Go
Answer: Package template implements data-driven templates for generating textual output. Actions are data evaluations or control structures. Those actions are delimited by {{ and }}. All text outside actions is copied to the output unchanged.
Actions and unchanged text
Package template implements data-driven templates for generating textual output.
Actions are data evaluations or control structures.
Those actions are delimited by {{ and }}.
All text outside actions is copied to the output unchanged.
The same model in the package source
The package implements data-driven templates for generating textual output.
Actions, meaning data evaluations or control structures, use {{ and }} as delimiters.
Text outside actions is copied to the output unchanged.
See also
Claims
- id: C1 claim: The package implements data-driven templates for textual output. source: S1 evidence: "data-driven templates for generating textual output"
- id: C2 claim: Actions are delimited by {{ and }}. source: S1 evidence: "delimited by \"{{\" and \"}}\""
- id: C3 claim: Text outside actions is copied to the output unchanged. source: S2 evidence: "copied to the output unchanged"
Sources
- [S1] text/template package reference. Go. https://pkg.go.dev/text/template . License: BSD-3-Clause. Accessed 2026-11-23.
- [S2] text/template source. Go. https://go.dev/src/text/template/doc.go . License: BSD-3-Clause. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, text/template package reference; Go, text/template source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go, text/template package reference; Go, text/template source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "text/template: data-driven textual output in Go." iinventedlight Library, iil:note:rsprkyte, version of 2026-11-23. https://iinventedlight.com/library/notes/go-text-template/. License: CC-BY-4.0.
@misc{iil_note_rsprkyte,
author = {{iinventedlight}},
title = {{text/template: data-driven textual output in Go}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/go-text-template/},
note = {Permanent ID iil:note:rsprkyte. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-text-template.schema.json (schema; CC-BY-4.0)
- go-text-template.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-text-template.md.