]> Cypherpunks repositories - gostls13.git/commit
html/template: add examples of loading templates from files
authorEmmanuel Odeke <emm.odeke@gmail.com>
Tue, 12 Apr 2016 08:55:14 +0000 (01:55 -0700)
committerAndrew Gerrand <adg@golang.org>
Wed, 13 Apr 2016 02:28:28 +0000 (02:28 +0000)
commit3f66d8c84b4b3d685db1031954d3343a7a8c9d0f
tree1250d1f573e6ebe69ff7e4b837bfe52c909dcf5d
parentdb5338f87982086a19310ad6e25c046280644b98
html/template: add examples of loading templates from files

Adds examples showing loading templates from files and
executing them.

Shows examples:
- Using ParseGlob.
- Using ParseFiles.
- Using helper functions to share and use templates
in different contexts by adding them to an existing
bundle of templates.
- Using a group of driver templates with distinct sets
of helper templates.

Almost all of the code was directly copied from text/template.

Fixes #8500

Change-Id: Ic3d91d5232afc5a1cd2d8cd3d9a5f3b754c64225
Reviewed-on: https://go-review.googlesource.com/21854
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/html/template/examplefiles_test.go [new file with mode: 0644]