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 ¶
Tprintf formats a string by replacing %{.key} placeholders with values from the given key-value pairs.
Example ¶
package main
import (
"fmt"
gofmt "github.com/foomo/go/fmt"
)
func main() {
format := "%{.name} is %{.age} years old"
fmt.Println(gofmt.Tprintf(format, "name", "John", "age", "30"))
}
Output: John is 30 years old
Types ¶
This section is empty.