vars

package
v1.21.11 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 4 Imported by: 3

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

Jump to

Keyboard shortcuts

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