Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't self-reference the x_package.go's own package in import proxy's argument types #163

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WilliamNHarvey
Copy link

@WilliamNHarvey WilliamNHarvey commented Jan 23, 2025

Fixes a bug in genimport with proxy package types.

In my example, before we would write

package williamnharveyfrontend
...
DoSomethingWithInterfaceStruct_	func(interface{}, context.Context, *williamnharveyfrontend.InterfaceStruct) (*williamnharveyfrontend.InterfaceStruct, error)

But after we correctly write

package williamnharveyfrontend
...
DoSomethingWithInterfaceStruct_	func(interface{}, context.Context, *InterfaceStruct) (*InterfaceStruct, error)

This frontend/backend pattern is common in golang apps that use stubbing for tests or for optional ways to implement a common backend

Happy to rip out the example and only merge the actual fix upstream if that's preferred. I didn't see an existing test otherwise

@WilliamNHarvey WilliamNHarvey marked this pull request as ready for review January 23, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant