type checkfunc func() string
var templateFuncs = make(map[string]checkfunc)
var templateFuncsMu sync.RWMutex
func RegisterTemplateFunc(a, b string, f checkfunc) {
templateFuncsMu.Lock()
templateFuncs[a+"/"+b] = f
templateFuncsMu.Unlock()
}
func TemplateFunc(a, b string) checkfunc {
templateFuncsMu.RLock()
f := templateFuncs[a+"/"+b]
templateFuncsMu.RUnlock()
return f
}
2016. augusztus 16., kedd 11:45:02 UTC+2 időpontban Mahesh Bhat a
következőt írta:
>
>
>
> On Friday, August 12, 2016 at 1:49:25 AM UTC+5:30, Tamás Gulácsi wrote:
>>
>> You have to manage the name->function map. Use a Register function to
>> hide it.
>
>
> Can you please elaborate ?
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.