diff --git a/pkg/templatelib/lib_example_test.go b/pkg/templatelib/lib_example_test.go index 53a4495a..2fd7b861 100644 --- a/pkg/templatelib/lib_example_test.go +++ b/pkg/templatelib/lib_example_test.go @@ -219,3 +219,17 @@ func Example_getenv() { // BAZ: foobar // FOOBARBAZ } + +func Example_sha256sum() { + tmpl, err := template.New("sha256sum").Funcs(templatelib.FuncMap).Parse(` + {{- "Hello World!" | sha256sum -}} + `) + + err = tmpl.Execute(os.Stdout, nil) + if err != nil { + panic(err) + } + + // Output: + // 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069 +}