Hein, you can try passing a function to the template. That is, a function 
which de-normalizes your person struct into an ad-hoc Num + Name record

See here: https://play.golang.org/p/1XIIO-0lcu

Cheers
Silviu

On Friday, 6 October 2017 01:22:49 UTC-4, 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