Open geekofalltrades opened 1 year ago
Hey @geekofalltrades,
I think the problem here is a _test.go suffix rather than internal package because it works fine with internal packages. Try putting the interface you're trying to generate decorator for somewhere else. There's not very much sense to parse test files.
Let me know if it's your case. I think I have to document it because it's not the first time people face this issue.
This seemed to be working in a _test.go file when I moved that file out of an internal package.
Also, it makes sense to me to have this particular interface in a _test.go file, because I'm using it to test a custom gowrap template.
But, there was no non-_test.go
-suffixed file in the directory, so possibly the whole directory was not registering as a Go package. And when I moved it out of the internal package, it was into a directory that had other go files in it that were not _test.go files.
When I try to generate a wrapper from an interface in an internal package, gowrap fails.
/path/to/package/internal/generated/prom_test.go
:Moving the file out of the internal subpackage makes it work.