[go-nuts] How to accept any function with one return value as a parameter

2017-03-19 Thread aktungmak
Hi, I am trying to write a function that initializes a generic collection. For adding new items to the collection, the user specifies a constructor which takes one argument and returns a pointer to the struct that will be inserted in the collection, and also sets fields to initial values. For

Re: [go-nuts] How to accept any function with one return value as a parameter

2017-03-20 Thread Konstantin Khomoutov
On Sun, 19 Mar 2017 13:51:05 -0700 (PDT) aktungmak wrote: > I am trying to write a function that initializes a generic > collection. For adding new items to the collection, the user > specifies a constructor which takes one argument and returns a > pointer to the struct that will be inserted in t