summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/fmt/Errorf.md
blob: 799622f0e70bb8ee9267251e095f5295fcfc8402 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
title: fmt.Errorf
description: Log an ERROR from a template.
categories: []
keywords: []
params:
  functions_and_methods:
    aliases: [errorf]
    returnType: string
    signatures: ['fmt.Errorf FORMAT [INPUT]']
aliases: [/functions/errorf]
---

{{% include "/_common/functions/fmt/format-string.md" %}}

The `errorf` function evaluates the format string, then prints the result to the ERROR log and fails the build.

```go-html-template
{{ errorf "The %q shortcode requires a src argument. See %s" .Name .Position }}
```

Use the [`erroridf`] function to allow optional suppression of specific errors.

[`erroridf`]: /functions/fmt/erroridf/