luci: go.chromium.org/luci/common/data/text/stringtemplate Index | Files

package stringtemplate

import "go.chromium.org/luci/common/data/text/stringtemplate"

Package stringtemplate implements Python string.Template-like substitution.

Index

Package Files

template.go

func Resolve Uses

func Resolve(v string, subst map[string]string) (string, error)

Resolve resolves substitutions in v using the supplied substitution map, subst.

A substitution can have the form:

$key
${key}

The substitution can also be escaped using a second "$", such as "$$".

If the string includes an erroneous substitution, or if a referenced template variable isn't included in the "substitutions" map, Resolve will return an error.

Package stringtemplate imports 3 packages (graph). Updated 2018-10-23. Refresh now. Tools for package owners.