转到模板循环(排列)出注释

At the end of my posts.html I need to loop over 2 elements in the Struct as without range I just get the last entry in mysql but although the rest of the structure stuff above is rendering fine the html output stops when it hits the range. Do i need to specify to only range over 2 elements in my Struct ?

{{range .}}
<p>{{.Name}}</p>
<p>{{.Comment}}</p>
{{end}}

Here is my current go code - http://play.golang.org/p/QMT12qfaoC

As an aside I have also lost the ability to render only mysql data matching the URL which also needs fixing.

Do i need to specify to only range over 2 elements in my Struct ?

You don't need to range over fields in a struct, this would be enough since you are just passing one post to post.html :

<p>{{.Name}}</p>
<p>{{.Comment}}</p>