icz*_*cza 8
templatetext/templatehtml/template
html/templatetext/template
html/templatetext/htmlhtml/template
text/template
Argument
    The result is the value of evaluating the argument.
.Method [Argument...]
    The method can be alone or the last element of a chain but,
    unlike methods in the middle of a chain, it can take arguments.
    The result is the value of calling the method with the
    arguments:
        dot.Method(Argument1, etc.)
functionName [Argument...]
    The result is the value of calling the function associated
    with the name:
        function(Argument1, etc.)
    Functions and function names are described below.
"参数"和"管道"是对数据的评估.
.{{range}}{{with}}
执行模板遍历结构并设置光标,由句点'.'表示.并且在执行过程中将"dot"称为结构中当前位置的值.
.NameNamestruct.NameNameName()
{{template "something" .}}Name{{template "something" .Name}}
{{template}}
$
执行开始时,$设置为传递给Execute的数据参数,即dot的起始值.
{{range}}
{{range .Books}}Name{{range}}
{{range .Books}}
    Title: {{.Title}}
    Original name: {{$.Name}}
{{end}}