← All notes

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

Sources

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

Permanent ID: iil:note:rsprkyte

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.},
}

Markdown

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.

All artifact files (JSON index)

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.