Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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.

Copy link
Owner Author

techslides commented Feb 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.