We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc4c23b commit b9a5bd8Copy full SHA for b9a5bd8
1 file changed
pkg/templatelib/lib_example_test.go
@@ -219,3 +219,17 @@ func Example_getenv() {
219
// BAZ: foobar
220
// FOOBARBAZ
221
}
222
+
223
+func Example_sha256sum() {
224
+ tmpl, err := template.New("sha256sum").Funcs(templatelib.FuncMap).Parse(`
225
+ {{- "Hello World!" | sha256sum -}}
226
+ `)
227
228
+ err = tmpl.Execute(os.Stdout, nil)
229
+ if err != nil {
230
+ panic(err)
231
+ }
232
233
+ // Output:
234
+ // 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
235
+}
0 commit comments