On Mon, Aug 27, 2012 at 9:19 PM, RoboTamer <
grue...@gmail.com> wrote:
> In Linux the pipe is: | and in go it is . (a dot)
That's not correct.
dot is the "cursor variable", like a cursor in a text editor.
"Templates are executed by applying them to a data structure.
Annotations in the template refer to elements of the data structure
(typically a field of a struct or a key in a map) to control execution
and derive values to be displayed. Execution of the template walks the
structure and sets the cursor, represented by a period '.' and called
"dot", to the value at the current location in the structure as
execution proceeds."
eg.
<h1>Editing {{.Title}}</h1>
is getting the 'Title' field from the cursor variable.
> So all I had to do is change {{template "Content"}} to {{template "Content" . }}
Here you are passing the cursor variable to the "Content" template.
http://golang.org/pkg/text/template/
--
=====================
http://jessta.id.au