Skip to content

Commit

Permalink
Adds TimeNow template helper
Browse files Browse the repository at this point in the history
So you can use something like {{TimeNow.Format "15:04:05"}}, to add
timestamps to your actions.
  • Loading branch information
rubiojr authored and muesli committed Apr 30, 2020
1 parent 4a7dee1 commit 59e5fc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templatehelper/templatehelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"regexp"
"strings"
"text/template"
"time"
)

// FuncMap contains a few convenient template helpers
Expand Down Expand Up @@ -96,6 +97,7 @@ var (
"SplitAfter": strings.SplitAfter,
"SplitAfterN": strings.SplitAfterN,
"SplitN": strings.SplitN,
"TimeNow": time.Now,
"Title": strings.Title,
"ToLower": strings.ToLower,
"ToTitle": strings.ToTitle,
Expand Down

0 comments on commit 59e5fc1

Please sign in to comment.