fmt.Errorf
Logs an ERROR from a template.
- Syntax
- fmt.Errorf FORMAT [INPUT]
- Returns
- string
- Alias
- errorf
Usage
The fmt.Errorf function logs an ERROR from a template. The function formats INPUT according to FORMAT, writes the result to the ERROR log, and fails the build. The function returns an empty string.
The documentation for Go’s fmt package describes the structure and content of the format string.
To allow suppression of specific errors, use the fmt.Erroridf function instead.
Examples
{{ fmt.Errorf "The %q shortcode requires a src argument. See %s" .Name .Position }}Last updated:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page