tpl/transform: Add transform.Unmarshal func

Fixes #5428
This commit is contained in:
Bjørn Erik Pedersen
2018-12-21 16:21:13 +01:00
parent 43f9df0194
commit 822dc627a1
20 changed files with 633 additions and 74 deletions

View File

@@ -95,6 +95,14 @@ func init() {
},
)
ns.AddMethodMapping(ctx.Unmarshal,
[]string{"unmarshal"},
[][2]string{
{`{{ "hello = \"Hello World\"" | transform.Unmarshal }}`, "map[hello:Hello World]"},
{`{{ "hello = \"Hello World\"" | resources.FromString "data/greetings.toml" | transform.Unmarshal }}`, "map[hello:Hello World]"},
},
)
return ns
}