Skip to content

Commit 91633b5

Browse files
authored
Merge pull request #91 from infosiftr/sha256sum-test
Add test for sha256sum function
2 parents bc4c23b + b9a5bd8 commit 91633b5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkg/templatelib/lib_example_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,17 @@ func Example_getenv() {
219219
// BAZ: foobar
220220
// FOOBARBAZ
221221
}
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

Comments
 (0)