Open eliben opened 3 years ago
Yes, I've been meaning to do that, but it's really tricky. I've got a branch where it kinda works, but I have to break out all the special cases we have into their own functions and insert those into the spec. We'd also need to inline a whole lot of string manipulation functions. One day :)
Currently the generated code has a dependency on
pkg/runtime
in this module, mostly to supportBind*
functions.While generated methods of the wrapper know exactly which types are needed in Go for the params, they call fairly generic
Bind*
functions that take these params viainterface{}
. This seems a bit backward - if we already have a concrete type, why bind it through a generic function that uses runtime dispatch?It should be possible for the generated code to directly bind parameters - given a known concrete type it should be only a few lines of code per parameter. This would be faster, but more importantly dependency-free - the generated code would only be dependent on Echo (or other framework used).