Documentation ¶
Overview ¶
Package lib implements some library functions used by gentmpl utility.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveIncludes ¶
ResolveIncludes returns a modified version of the input mapping. It filter the elements taking only the keys found in the names array. Moreover every item that corrispond to a mapping key name is (recursivery) expanded with the mapping items. It returs an error in case of cyclic includes.
Example ¶
var ( mapping = map[string][]string{ "inc": {"header", "footer"}, "A": {"contentA", "inc"}, "B": {"contentB", "inc"}, } names = []string{"A", "B"} ) res, _ := ResolveIncludes(mapping, names) fmt.Println(res["A"]) fmt.Println(res["B"])
Output: [contentA header footer] [contentB header footer]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.