Create a gist now

Instantly share code, notes, and snippets.

Martini Render FuncMap Function to unescape string into HTML and time converting
//needs import ("time")
Directory: "templates",
Layout: "layout",
Funcs: []template.FuncMap{
"formatTime": func(args ...interface{}) string {
t1 := time.Unix(args[0].(int64), 0)
return t1.Format(time.Stamp)
"unescaped": func(args ...interface{}) template.HTML {
r eturn template.HTML(args[0].(string))

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment