Skip to content

Commit

Permalink
Merge pull request #91 from infosiftr/sha256sum-test
Browse files Browse the repository at this point in the history
Add test for sha256sum function
  • Loading branch information
tianon authored Jan 22, 2024
2 parents bc4c23b + b9a5bd8 commit 91633b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/templatelib/lib_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 91633b5

Please sign in to comment.