I have this func:
func Middleware(adapters ...interface{}) http.HandlerFunc {
// ...
}
and I am trying to call it via:
middleware := []mw.Adapter{mw.Error(),mw.Auth("x-huru-api-token")}
router.HandleFunc("/person_data_field",
mw.Middleware(middleware...,h.makeGetMany(v))).Methods("GET")
this doesn't compile though, I get:
In any case, I need to spread the slice so that it is sent as multiple arguments not just one arg...
With JS, it just looks like this:
const v = [1,2,3];
const f = function(...values){
console.log(values); // [1,2,3,4]
};
f(...v,4);