package fmt
import "github.com/gohugoio/hugo/tpl/fmt"
Package fmt provides template functions for formatting strings.
Index ¶
- type Namespace
- func New(d *deps.Deps) *Namespace
- func (ns *Namespace) Errorf(format string, args ...any) string
- func (ns *Namespace) Erroridf(id, format string, args ...any) string
- func (ns *Namespace) Errormf(m any, format string, args ...any) string
- func (ns *Namespace) Print(args ...any) string
- func (ns *Namespace) Printf(format string, args ...any) string
- func (ns *Namespace) Println(args ...any) string
- func (ns *Namespace) Warnf(format string, args ...any) string
- func (ns *Namespace) Warnidf(id, format string, args ...any) string
- func (ns *Namespace) Warnmf(m any, format string, args ...any) string
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace provides template functions for the "fmt" namespace.
func New ¶
New returns a new instance of the fmt-namespaced template functions.
func (*Namespace) Errorf ¶
Errorf formats args according to a format specifier and logs an ERROR. It returns an empty string.
func (*Namespace) Erroridf ¶
Erroridf formats args according to a format specifier and logs an ERROR and an information text that the error with the given id can be suppressed in config. It returns an empty string.
func (*Namespace) Errormf ¶
Errormf is experimental and subject to change at any time.
func (*Namespace) Print ¶
Print returns a string representation of args.
func (*Namespace) Printf ¶
Printf returns string representation of args formatted with the layout in format.
func (*Namespace) Println ¶
Println returns string representation of args ending with a newline.
func (*Namespace) Warnf ¶
Warnf formats args according to a format specifier and logs a WARNING. It returns an empty string.
func (*Namespace) Warnidf ¶
Warnidf formats args according to a format specifier and logs an WARNING and an information text that the warning with the given id can be suppressed in config. It returns an empty string.
func (*Namespace) Warnmf ¶
Warnmf is experimental and subject to change at any time.
Source Files ¶
- Version
- v0.144.2 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 7 hours ago –
Tools for package owners.