[go-nuts] Re: The "call" function of Go template

2017-07-05 Thread Tong Sun
Thanks a lot!

On Wednesday, July 5, 2017 at 8:16:09 PM UTC-4, Guy Allard wrote:
>
> Maybe take a look at:
>
> https://github.com/golang/go/issues/10653
>
> and/or
>
> https://play.golang.org/p/Ka8bN3_V1f
>
> to understand what works, and what does not.
>
>
> On Wednesday, July 5, 2017 at 11:58:02 AM UTC-4, Tong Sun wrote:
>>
>> Can somebody give an example for the following? I made several attempts 
>> but none is working. Thanks. 
>>
>> call
>>  Returns the result of calling the first argument, which
>>  must be a function, with the remaining arguments as parameters.
>>  Thus "call .X.Y 1 2" is, in Go notation, dot.X.Y(1, 2) where
>>  Y is a func-valued field, map entry, or the like.
>>  The first argument must be the result of an evaluation
>>  that yields a value of function type (as distinct from
>>  a predefined function such as print). The function must
>>  return either one or two result values, the second of which
>>  is of type error. If the arguments don't match the function
>>  or the returned error value is non-nil, execution stops.
>>
>>
>>
>>

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


[go-nuts] Re: The "call" function of Go template

2017-07-05 Thread Guy Allard
Maybe take a look at:

https://github.com/golang/go/issues/10653

and/or

https://play.golang.org/p/Ka8bN3_V1f

to understand what works, and what does not.


On Wednesday, July 5, 2017 at 11:58:02 AM UTC-4, Tong Sun wrote:
>
> Can somebody give an example for the following? I made several attempts 
> but none is working. Thanks. 
>
> call
>   Returns the result of calling the first argument, which
>   must be a function, with the remaining arguments as parameters.
>   Thus "call .X.Y 1 2" is, in Go notation, dot.X.Y(1, 2) where
>   Y is a func-valued field, map entry, or the like.
>   The first argument must be the result of an evaluation
>   that yields a value of function type (as distinct from
>   a predefined function such as print). The function must
>   return either one or two result values, the second of which
>   is of type error. If the arguments don't match the function
>   or the returned error value is non-nil, execution stops.
>
>
>
>

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