fmt.Erroridf
语法
fmt.Erroridf ID FORMAT [INPUT]
返回值
string
别名
erroridf
Go 的 fmt 包的文档描述了格式字符串的结构和内容。
erroridf
函数计算格式字符串,然后将结果打印到错误日志并使构建失败。与 errorf
函数不同,您可以通过将消息 ID 添加到站点配置中的 ignoreLogs
数组来抑制 erroridf
函数记录的错误。
此模板代码
{{ erroridf "error-42" "You should consider fixing this." }}
产生此控制台日志
ERROR You should consider fixing this.
You can suppress this error by adding the following to your site configuration:
ignoreLogs = ['error-42']
要抑制此消息
hugo.
ignoreLogs:
- error-42
ignoreLogs = ['error-42']
{
"ignoreLogs": [
"error-42"
]
}