Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abhinav
Copy link
Contributor

@abhinav abhinav commented Oct 4, 2025

The mockgen/model package was importable only for reflect mode.
In reflect mode, the generated code would import model,
which would then use reflection to export information about types.

Reflect mode is not a thing anymore,
so there's no need for model to be externally accessible.

Move it into an internal package and update all imports
except those inside the bazel/ directory for the following reasons:

The mockgen/model package was importable only for reflect mode.
In reflect mode, the generated code would import model,
which would then use reflection to export information about types.

Reflect mode is not a thing anymore,
so there's no need for model to be externally accessible.

Move it into an internal package and update all imports
*except* those inside the bazel/ directory for the following reasons:

- bazel/ is pinned to an older version of this package
- those references will be deleted in uber-go#285
@abhinav abhinav marked this pull request as draft October 4, 2025 23:07
@abhinav
Copy link
Contributor Author

abhinav commented Oct 4, 2025

Actually, this requires some discussion.
This will also make gob mode useless as well, so maybe this is undesirable.

@JacobOaks, if y'all think gob mode is necessary, we should close this PR.

abhinav added a commit to abhinav/gomock that referenced this pull request Oct 4, 2025
Alternative to uber-go#286

Reflect mode has been deprecated in favor of package mode.
These functions, which were intended to be called from the generated
code in reflect mode, are no longer needed.

Delete them.
@abhinav
Copy link
Contributor Author

abhinav commented Oct 5, 2025

Yeah this one is a bad idea. It’ll also block anyone using model import to declare a tool dependency on mockgen cli

@abhinav abhinav closed this Oct 5, 2025
@JacobOaks
Copy link
Contributor

JacobOaks commented Oct 6, 2025

Yeah, I think we still need this for at Uber as well until we migrate off of gob mode on to the new bazel rules

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.

2 participants