Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for sha256sum function #91

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Loading