Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(template string, vars map[string]string) (string, error)

Expand replaces all variables like {var} by `vars` map, it always returns the expanded string regardless of errors if error occurs, the error part doesn't change and is returned as it is.

Types

type ErrVarMissing

type ErrVarMissing struct {
	Template string
	Var      string
}

ErrVarMissing represents an error that no matched variable

func (ErrVarMissing) Error

func (err ErrVarMissing) Error() string

type ErrWrongSyntax

type ErrWrongSyntax struct {
	Template string
}

ErrWrongSyntax represents a wrong syntax with a template

func (ErrWrongSyntax) Error

func (err ErrWrongSyntax) Error() string
?: This menu
/: Search site
f or F: Jump to
y or Y: Canonical URL