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, a ...interface{}) string
- func (ns *Namespace) Erroridf(id, format string, a ...interface{}) string
- func (ns *Namespace) Print(a ...interface{}) string
- func (ns *Namespace) Printf(format string, a ...interface{}) string
- func (ns *Namespace) Println(a ...interface{}) string
- func (ns *Namespace) Warnf(format string, a ...interface{}) 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 according to a format specifier and logs an ERROR. It returns an empty string.
func (*Namespace) Erroridf ¶
Erroridf formats 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 ¶
Print returns string representation of the passed arguments.
func (*Namespace) Printf ¶
Printf returns a formatted string representation of the passed arguments.
func (*Namespace) Println ¶
Println returns string representation of the passed arguments ending with a newline.
func (*Namespace) Warnf ¶
Warnf formats according to a format specifier and logs a WARNING. It returns an empty string.
Source Files ¶
- Version
- v0.90.0
- Published
- Dec 8, 2021
- Platform
- darwin/amd64
- Imports
- 5 packages
- Last checked
- 10 minutes ago –
Tools for package owners.