Back to godoc.org
github.com/luci/luci-go / common / data / text / stringtemplate

Package stringtemplate

v0.0.0-...-d4769a7
Latest Go to latest

The latest major version is .

Published: Aug 1, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package stringtemplate implements Python string.Template-like substitution.

Index

func Resolve

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier