HUGO
Menu
GitHub 90498 stars Mastodon

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