Beispiel #1
0
func flowString(root yaml.Node, env Environment) yaml.Node {

	sub := yaml.EmbeddedDynaml(root)
	if sub == nil {
		return root
	}
	debug.Debug("dynaml: %v: %s\n", env.Path, *sub)
	expr, err := dynaml.Parse(*sub, env.Path, env.StubPath)
	if err != nil {
		return root
	}

	return yaml.SubstituteNode(expr, root)
}
Beispiel #2
0
func flowString(root yaml.Node, env Environment) yaml.Node {
	rootString := root.Value().(string)

	sub := embeddedDynaml.FindStringSubmatch(rootString)
	if sub == nil {
		return root
	}

	expr, err := dynaml.Parse(sub[1], env.Path)
	if err != nil {
		return root
	}

	return yaml.NewNode(expr, root.SourceName())
}