title |
linkTitle |
description |
categories |
keywords |
menu |
function |
relatedFunctions |
aliases |
fmt.Errorf |
errorf |
Log an ERROR from a template. |
|
|
|
aliases |
returnType |
signatures |
|
string |
fmt.Errorf FORMAT [INPUT] |
|
|
fmt.Errorf |
fmt.Erroridf |
fmt.Warnf |
|
|
The documentation for Go's fmt package describes the structure and content of the format string.
Like the printf
function, the errorf
function evaluates the format string. It then prints the result to the ERROR log and fails the build. Hugo prints each unique message once to avoid flooding the log with duplicate errors.
{{ errorf "The %q shortcode requires a src parameter. See %s" .Name .Position }}
Use the erroridf
function to allow optional suppression of specific errors.