package fmt

import "github.com/gohugoio/hugo/tpl/fmt"

Package fmt provides template functions for formatting strings.

Index

Package Files

fmt.go init.go

type Namespace

type Namespace struct {
    // contains filtered or unexported fields
}

Namespace provides template functions for the "fmt" namespace.

func New

func New(d *deps.Deps) *Namespace

New returns a new instance of the fmt-namespaced template functions.

func (*Namespace) Errorf

func (ns *Namespace) Errorf(format string, args ...any) string

Errorf formats args according to a format specifier and logs an ERROR. It returns an empty string.

func (*Namespace) Erroridf

func (ns *Namespace) Erroridf(id, format string, args ...any) string

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) Print

func (ns *Namespace) Print(args ...any) string

Print returns a string representation args.

func (*Namespace) Printf

func (ns *Namespace) Printf(format string, args ...any) string

Printf returns a formatted string representation of args.

func (*Namespace) Println

func (ns *Namespace) Println(args ...any) string

Println returns string representation of args ending with a newline.

func (*Namespace) Warnf

func (ns *Namespace) Warnf(format string, args ...any) string

Warnf formats args according to a format specifier and logs a WARNING. It returns an empty string.

Version
v0.101.0 (latest)
Published
Jun 16, 2022
Platform
linux/amd64
Imports
5 packages (graph)
Last checked
3 hours ago

Tools for package owners.