Go模板示例[关闭]

What website has some good, up to date resources on using Go html/templates, especially in regard to parsing html files and handling lists? I came across the Hoka Poka website, but it seems to be out of date.

Google App Engine docs have a simple example showing how to use template to render list with range.

For "html/template", there are snippets of template code in the doc at http://code.google.com/p/go/source/browse/src/pkg/html/template/doc.go#83

Contexts

Assuming {{.}} is O'Reilly: How are <i>you</i>?, the table below shows how {{.}} appears when used in the context to the left.

Context                          {{.}} After
{{.}}                            O'Reilly: How are &lt;i&gt;you&lt;/i&gt;?
<a title='{{.}}'>                O&#39;Reilly: How are you?
<a href="/{{.}}">                O&#39;Reilly: How are %3ci%3eyou%3c/i%3e?

and the test suite has many examples: https://code.google.com/p/go/source/browse/src/html/template/escape_test.go

To see templates in action, look at the godoc source code. http://code.google.com/p/go/source/browse/src/cmd/godoc/godoc.go#642 is a good starting point.

http://blog.zmxv.com/2011/09/go-template-examples.html has a list of code snippets for the new Go template package.