Documentation ¶
Overview ¶
Package subst does string substituion in build fields.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// MaxShortShaLength is the length of the shortsha.
MaxShortShaLength = 7
)
Functions ¶
func SubstituteBuildFields ¶
SubstituteBuildFields does an in-place string substitution of build parameters. User-defined substitutions are also accepted. If a built-in substitution value is not defined (perhaps a sourceless build, or storage source), then the corresponding substitutions will result in an empty string.
Types ¶
type TemplateParameter ¶
type TemplateParameter struct {
Start, End int
Key string
Escape bool // if true, this parameter is `$$`
}
TemplateParameter represents the position of a Key in a string.
func FindTemplateParameters ¶
func FindTemplateParameters(input string) []*TemplateParameter
FindTemplateParameters finds all the parameters in the string `input`, which are not escaped, and returns an array.
Click to show internal directories.
Click to hide internal directories.