Documentation
¶
Overview ¶
Package format implements the Go-template-to-formatted-Go pipeline.
Format(text) parses the text as a Go template, replaces each {{…}} action with a sentinel, runs gofumpt on the resulting Go, then substitutes the original action bytes back. When gofumpt rejects the stubbed Go, Format falls back to the parser's own AST printer so the output is at least idempotent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format formats a Go template source string. The interface is deliberately minimal: no options, no modes.
Returns an error only for genuine parse failures of the template itself. gofumpt rejection of the stubbed Go is handled internally by falling back to the AST printer; the caller never sees that.
Types ¶
This section is empty.