You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go generate ./...
failed to parse source package: open repo.git/path/to/package/internal/generated: no such file or directory
internal/generated/prom_test.go:3: running "gowrap": exit status 1
Moving the file out of the internal subpackage makes it work.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: