Closed jinnovation closed 5 years ago
Actually the []interface{}
is what what go/types
package returns, not the interfacer one. I can take a look if there's any field that can be used to make a distinction.
For now workaround - please edit the signature manually 😇
Thanks @jinnovation for the report!
Hey there, this issue is really old, but there is a way to fix this using types.Signature.Variadic() method if you want to do the formatting manually.
@sbward Thanks for pointing out, I must have missed that. Would you like to try sending a PR for that?
In my fork, I attempted to do it while preserving your structer/interfacer shared formatting code, but in the end I decided to just use gotypes Signature String formatter and delete structer. As a result my fork is now just a simpler implementation of interfacer by itself. It's up to you to decide if you want to take a similar approach and break apart interfacer/structer implementations, or bite the bullet and figure out how to use Signature.Variadic in the existing codebase.
@sbward Added support for variadic args, lmk how that works for you.
Input struct:
"github.com/gocql/gocql".Session
Output:
Corresponding function signature (see
github.com/gocql/gocql/session.go
: