Help us shape the future of Go! Take the 2026 Go Developer Survey

vars

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 4 Imported by: 0

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

Source Files

  • vars.go

Jump to

Keyboard shortcuts

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