diff options
Diffstat (limited to 'docs/content/en/functions/fmt/Warnf.md')
-rw-r--r-- | docs/content/en/functions/fmt/Warnf.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/content/en/functions/fmt/Warnf.md b/docs/content/en/functions/fmt/Warnf.md index 0a90251d3..f4fa22474 100644 --- a/docs/content/en/functions/fmt/Warnf.md +++ b/docs/content/en/functions/fmt/Warnf.md @@ -8,6 +8,7 @@ action: related: - functions/fmt/Errorf - functions/fmt/Erroridf + - functions/fmt/Warnidf returnType: string signatures: ['fmt.Warnf FORMAT [INPUT]'] aliases: [/functions/warnf] @@ -21,6 +22,8 @@ The `warnf` function evaluates the format string, then prints the result to the {{ warnf "The %q shortcode was unable to find %s. See %s" .Name $file .Position }} ``` +Use the [`warnidf`] function to allow optional suppression of specific warnings. + To prevent suppression of duplicate messages when using `warnf` for debugging, make each message unique with the [`math.Counter`] function. For example: @@ -30,4 +33,6 @@ To prevent suppression of duplicate messages when using `warnf` for debugging, m {{ end }} ``` -[`math.Counter`]: /functions/math/counter +[`math.Counter`]: /functions/math/counter/ + +[`warnidf`]: /functions/fmt/warnidf/ |