Lets say the body of my html file like so
<body>
<h2>Current number of players: {{.active}}</h2>
</body>
And my go code looks like
type page struct{
active string
}
t, _ template.ParseFiles("page.html")
t.Execute(w,page{active: "No Players are Online"})
When I run the code, I get a blank screen. When I change {{.active}} to {{printf "%s" .active}} it works.
Do I always need to include printf? I guess I'm confused by the documentation.
Thanks!