Skip to content

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

Open
WilliamNHarvey wants to merge 2 commits into
cosmos72:masterfrom
WilliamNHarvey:wh/fix-self-referenting-package-in-importer-proxies
Open

Don't self-reference the x_package.go's own package in import proxy's argument types#163
WilliamNHarvey wants to merge 2 commits into
cosmos72:masterfrom
WilliamNHarvey:wh/fix-self-referenting-package-in-importer-proxies

Conversation

@WilliamNHarvey
Copy link
Copy Markdown

@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