This is the right answer and a good explanation. Thanks. 


On Monday, August 27, 2012 at 5:08:28 AM UTC-7, Jesse McNelis wrote:
>
> On Mon, Aug 27, 2012 at 9:19 PM, RoboTamer <grue...@gmail.com 
> <javascript:>> 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 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to