Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -3,18 +3,15 @@ title: fmt.Errorf
description: Log an ERROR from a template.
categories: []
keywords: []
action:
aliases: [errorf]
related:
- functions/fmt/Erroridf
- functions/fmt/Warnf
- functions/fmt/Warnidf
returnType: string
signatures: ['fmt.Errorf FORMAT [INPUT]']
params:
functions_and_methods:
aliases: [errorf]
returnType: string
signatures: ['fmt.Errorf FORMAT [INPUT]']
aliases: [/functions/errorf]
---
{{% include "functions/fmt/_common/fmt-layout.md" %}}
{{% 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.

View File

@@ -3,18 +3,15 @@ title: fmt.Erroridf
description: Log a suppressible ERROR from a template.
categories: []
keywords: []
action:
aliases: [erroridf]
related:
- functions/fmt/Errorf
- functions/fmt/Warnf
- functions/fmt/Warnidf
returnType: string
signatures: ['fmt.Erroridf ID FORMAT [INPUT]']
params:
functions_and_methods:
aliases: [erroridf]
returnType: string
signatures: ['fmt.Erroridf ID FORMAT [INPUT]']
aliases: [/functions/erroridf]
---
{{% include "functions/fmt/_common/fmt-layout.md" %}}
{{% include "/_common/functions/fmt/format-string.md" %}}
The `erroridf` function evaluates the format string, then prints the result to the ERROR log and fails the build. Unlike the [`errorf`] function, you may suppress errors logged by the `erroridf` function by adding the message ID to the `ignoreLogs` array in your site configuration.

View File

@@ -3,13 +3,11 @@ title: fmt.Print
description: Prints the default representation of the given arguments using the standard `fmt.Print` function.
categories: []
keywords: []
action:
aliases: [print]
related:
- functions/fmt/Printf
- functions/fmt/Println
returnType: string
signatures: [fmt.Print INPUT]
params:
functions_and_methods:
aliases: [print]
returnType: string
signatures: [fmt.Print INPUT]
aliases: [/functions/print]
---

View File

@@ -3,17 +3,15 @@ title: fmt.Printf
description: Formats a string using the standard `fmt.Sprintf` function.
categories: []
keywords: []
action:
aliases: [printf]
related:
- functions/fmt/Print
- functions/fmt/Println
returnType: string
signatures: ['fmt.Printf FORMAT [INPUT]']
params:
functions_and_methods:
aliases: [printf]
returnType: string
signatures: ['fmt.Printf FORMAT [INPUT]']
aliases: [/functions/printf]
---
{{% include "functions/fmt/_common/fmt-layout.md" %}}
{{% include "/_common/functions/fmt/format-string.md" %}}
```go-html-template
{{ $var := "world" }}

View File

@@ -3,13 +3,11 @@ title: fmt.Println
description: Prints the default representation of the given argument using the standard `fmt.Print` function and enforces a line break.
categories: []
keywords: []
action:
aliases: [println]
related:
- functions/fmt/Print
- functions/fmt/Printf
returnType: string
signatures: [fmt.Println INPUT]
params:
functions_and_methods:
aliases: [println]
returnType: string
signatures: [fmt.Println INPUT]
aliases: [/functions/println]
---

View File

@@ -3,18 +3,15 @@ title: fmt.Warnf
description: Log a WARNING from a template.
categories: []
keywords: []
action:
aliases: [warnf]
related:
- functions/fmt/Errorf
- functions/fmt/Erroridf
- functions/fmt/Warnidf
returnType: string
signatures: ['fmt.Warnf FORMAT [INPUT]']
params:
functions_and_methods:
aliases: [warnf]
returnType: string
signatures: ['fmt.Warnf FORMAT [INPUT]']
aliases: [/functions/warnf]
---
{{% include "functions/fmt/_common/fmt-layout.md" %}}
{{% include "/_common/functions/fmt/format-string.md" %}}
The `warnf` function evaluates the format string, then prints the result to the WARNING log. Hugo prints each unique message once to avoid flooding the log with duplicate warnings.

View File

@@ -3,20 +3,17 @@ title: fmt.Warnidf
description: Log a suppressible WARNING from a template.
categories: []
keywords: []
action:
aliases: [warnidf]
related:
- functions/fmt/Errorf
- functions/fmt/Erroridf
- functions/fmt/Warnf
returnType: string
signatures: ['fmt.Warnidf ID FORMAT [INPUT]']
params:
functions_and_methods:
aliases: [warnidf]
returnType: string
signatures: ['fmt.Warnidf ID FORMAT [INPUT]']
aliases: [/functions/warnidf]
---
{{< new-in 0.123.0 />}}
{{% include "functions/fmt/_common/fmt-layout.md" %}}
{{% include "/_common/functions/fmt/format-string.md" %}}
The `warnidf` function evaluates the format string, then prints the result to the WARNING log. Unlike the [`warnf`] function, you may suppress warnings logged by the `warnidf` function by adding the message ID to the `ignoreLogs` array in your site configuration.

View File

@@ -1,13 +0,0 @@
---
cascade:
_build:
list: never
publishResources: false
render: never
---
<!--
Files within this headless branch bundle are Markdown snippets. Each file must contain front matter delimiters, though front matter fields are not required.
Include the rendered content using the "include" shortcode.
-->

View File

@@ -1,7 +0,0 @@
---
_comment: Do not remove front matter.
---
The documentation for Go's [fmt] package describes the structure and content of the format string.
[fmt]: https://pkg.go.dev/fmt

View File

@@ -1,12 +1,7 @@
---
title: Fmt functions
linkTitle: fmt
description: Template functions to print strings within a template or to print messages to the terminal
description: Use these functions to print strings within a template or to print messages to the terminal.
categories: []
keywords: []
menu:
docs:
parent: functions
---
Use these functions to print strings within a template or to print messages to the terminal.