Is there a way to handle generic function in go : <p>I am new to go, and wanted to implement a scheduler that will recieve tasks(i.e interval + handler).
I got stuck in the part where I should get the handlers as go is a static language(I can't get a generic function signature).
I came up with the following solution:
each "handler" func will get wrapped by empty-interface:</p>

<pre><code>type GenericFunc interface{}
add_task(GenericFunc(my_func), p1, p2,...)
</code></pre>

<p>which will result in the following struct as for saving the handler and its params:</p>

<pre><code>type Task struct {
   handler reflect.Value
   params []reflect.Value
   ...
}
</code></pre>

<p>Tasks execution would be invoked by:</p>

<pre><code>func (t *Task) execute() {
    t.handler.Call(t.params)
}
</code></pre>

<p>My question is this the right way to treat generic functions or is there a more idiomatic solution I'm missing?
thx.</p>
