Documentation
¶
Overview ¶
Utilities for templating strings more easily
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capitalize ¶
Capitalize the first letter of a string Uses unicode title case rules. If the first character is not capitalizable, the string is returned unchanged.
func CheckProperty ¶
Dynamically resolve a dot-separated property path and check if the result matches a value
Types ¶
type TypedTemplate ¶
Define a template with a type-checked data type T
func NewTypedTemplate ¶
func NewTypedTemplate[T any](templateStr string) (*TypedTemplate[T], error)
func (*TypedTemplate[T]) ExecuteStr ¶
func (tpl *TypedTemplate[T]) ExecuteStr(data T) (string, error)
Click to show internal directories.
Click to hide internal directories.