Skip to content

Commit

Permalink
add sprig
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Nov 15, 2023
1 parent 73d44ca commit 5874bab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/oras/internal/option/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"html/template"
"io"

"github.com/Masterminds/sprig/v3"
"github.com/spf13/pflag"
)

Expand Down Expand Up @@ -48,7 +49,7 @@ func (opts *Format) WriteTo(w io.Writer, data interface{}) error {
default:
// go templating
var err error
t := template.New("out") // todo: add sprig .Funcs(sprigFuncs)
t := template.New("out").Funcs(sprig.FuncMap())
t, err = t.Parse(opts.template)
if err != nil {
return err
Expand Down

0 comments on commit 5874bab

Please sign in to comment.