AFAIK a template can only access the structure that's passed to to it.  It 
can't get at any of the other variables of the Go function that executes 
it, global or local.  All it can do is render the data in the structure 
that's passed to it.

On Friday, October 6, 2017 at 6:22:49 AM UTC+1, Hein Meling wrote:
>
> Hi all,
>
> Please see linked example code. I've been trying set a "global" variable 
> ($LastName in the example) for use inside a named template (phony in the 
> example), but the scoping rules for the template packages does not follow 
> common scoping rules typically used in other languages, including Go. And 
> it is not possible to pass more "arguments/pipelines" to the named 
> template. Any suggestions on how to accomplish something like this.
>
> https://play.golang.org/p/VjeNwr6RFe
>
> All the best,
> :) Hein
>

-- 
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