From: Rob Pike Date: Mon, 28 Feb 2011 18:27:33 +0000 (-0800) Subject: template: document the delimiters better X-Git-Tag: weekly.2011-03-07~73 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b2efedbf361d5d96ad0fd74e00cbc12801253087;p=gostls13.git template: document the delimiters better R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4248047 --- diff --git a/src/pkg/template/template.go b/src/pkg/template/template.go index 36fd06dc22..c3cb8901a0 100644 --- a/src/pkg/template/template.go +++ b/src/pkg/template/template.go @@ -24,7 +24,8 @@ - The result of invoking a niladic single-valued method with that name (result = data.field()) - Major constructs ({} are metacharacters; [] marks optional elements): + Major constructs ({} are the default delimiters for template actions; + [] are the notation in this comment for optional elements): {# comment } @@ -74,6 +75,11 @@ Multiple formatters separated by the pipeline character | are executed sequentially, with each formatter receiving the bytes emitted by the one to its left. + + The delimiter strings get their default value, "{" and "}", from + JSON-template. They may be set to any non-empty, space-free + string using the SetDelims method. Their value can be printed + in the output using {.meta-left} and {.meta-right}. */ package template