Skip to content

Commit

Permalink
Merge pull request #91 from bvieira/#87
Browse files Browse the repository at this point in the history
Feature: add os.Getenv as template function
  • Loading branch information
bvieira authored Jan 23, 2023
2 parents 192daa5 + bdd631a commit 952dcec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sv/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sv
import (
"bytes"
"io/fs"
"os"
"sort"
"text/template"
"time"
Expand Down Expand Up @@ -35,6 +36,7 @@ func NewOutputFormatter(templatesFS fs.FS) *OutputFormatterImpl {
templateFNs := map[string]interface{}{
"timefmt": timeFormat,
"getsection": getSection,
"getenv": os.Getenv,
}
tpls := template.Must(template.New("templates").Funcs(templateFNs).ParseFS(templatesFS, "*"))
return &OutputFormatterImpl{templates: tpls}
Expand Down

0 comments on commit 952dcec

Please sign in to comment.