20 lines
529 B
Go
20 lines
529 B
Go
|
package generator
|
||
|
|
||
|
import "regexp"
|
||
|
|
||
|
var (
|
||
|
// regexp to all tpl strings
|
||
|
tplValueRegexp = regexp.MustCompile(`\{\{.*\}\}-`)
|
||
|
|
||
|
// find all labels starting by __replace_ and ending with ":"
|
||
|
// and get the value between the quotes
|
||
|
// ?s => multiline
|
||
|
// (?P<inc>.+?) => named capture group to "inc" variable (so we could use $inc in the replace)
|
||
|
replaceLabelRegexp = regexp.MustCompile(`(?s)__replace_.+?: '(?P<inc>.+?)'`)
|
||
|
|
||
|
// Standard annotationss
|
||
|
Annotations = map[string]string{
|
||
|
KATENARY_PREFIX + "version": Version,
|
||
|
}
|
||
|
)
|