summaryrefslogtreecommitdiffstats
path: root/tpl/transform/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/transform/init.go')
-rw-r--r--tpl/transform/init.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/tpl/transform/init.go b/tpl/transform/init.go
index 86951c253..62cb0a9c3 100644
--- a/tpl/transform/init.go
+++ b/tpl/transform/init.go
@@ -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
}