Hi,
In my first version i have just implemented a function to interpolate something like this:
"{{ .house }} {{ .cosa_rara | upper }} " using the next maps:
varsContent := map[string]interface{}{
“mix”: "{{ .house }} {{ .cosa_rara | upper }} ",
“house”: “A {{ .the }} casita”,
“the”: “la {{ .cosa_rara | title }}”,
“animal”: “de {{ .the | title }} mariposa”,
“cosa_rara”: “demo_pato”,
“mapa”: “demo_pato”,
“cyclic”: “This is a {{ .cyclic }}”,
“colour”: map[string]interface{}{
“red”: “rojo”,
“blue”: “azul”,
“pink”: “rosa”,
“orange”: “{{ mapa }}”,
},
}
The result of this execution is: "A la Demo_pato casita DEMO_PATO ". As you can see, the interpolation is executed recursively and works fine. My problem now is implement a way to exectue this: “{{ .colour.orange }}”, the result of this execution should be “demo_pato” and in this point… I need help.
Thank you very much.