fmt

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package fmt provides template-based string formatting utilities extending the standard fmt package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tprintf

func Tprintf(format string, pairs ...string) string

Tprintf formats a string by replacing %{.key} placeholders with values from the given key-value pairs.

Example
package main

import (
	"fmt"

	fmtx "github.com/foomo/go/fmt"
)

func main() {
	format := "%{.name} is %{.age} years old"
	fmt.Println(fmtx.Tprintf(format, "name", "John", "age", "30"))

}
Output:
John is 30 years old

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL