template

package
v1.117.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Buffered

func Buffered(w io.Writer, content string, data any)

Buffered executes a template and writes the result to the given writer once. If an error occurs, it is written to the writer instead.

func BufferedE

func BufferedE(w io.Writer, content string, data any) error

BufferedE executes a template and writes the result to the given writer once.

func Funcs

func Funcs(colors charm.ColorScheme) template.FuncMap

Funcs returns template helpers.

func Print

func Print(content string, data any)

Print executes a template and prints it directly to stdout. If an error occurs, it is written to stderr as well.

func PrintE

func PrintE(content string, data any) error

PrintE executes a template and prints it directly to stdout.

func Render

func Render(w io.Writer, content string, data any) error

Render renders a template.

func String

func String(content string, data any) string

String executes a template and returns it as a string. If an error occurs, the error text is returned instead.

func StringE

func StringE(content string, data any) (string, error)

StringE executes a template and returns it as a string.

Types

type FuncMap

type FuncMap = template.FuncMap

Jump to

Keyboard shortcuts

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