I have the function
func front(w http.ResponseWriter, r *http.Request) {
posts, _ := client.HGet("post:1", "title")
tmpl.ExecuteTemplate(w, "index", posts)
}
a log println shows that there are results indeed
2014/06/04 21:44:23 [title test_title content this is a test content]
but I can't get it to show on the "index" template..
the "index" template is like following
{{define "index"}}
<p>{{.Posts}}</p>
{{end}}
My problem is that {{.Posts}} shows nothing. but it should show something like test_title content this is a test content
What I want is to access Redis results from html template.
Any idea on how to do that?