-
Notifications
You must be signed in to change notification settings - Fork 607
Document why a user should choose the source or reflect mode #406
Comments
Thanks for opening this issue, I agree this is something that should be addressed. I would like to leave this issue open a bit to collect user experiences. I know there are some edge cases out there that force people into one or the other, and honestly I don't know them all. If you have specific cases you have found please share! Also, I would like to know these difference so that in the future we can blur the lines and the cli just works. I would love to deprecate the need for some of the flags too eventually. Thanks for the report. |
One difference is how type aliases are handled, works correct in source mode: #244 |
mocking unexported interfaces requires source mode: #297 |
At Uber, we call mockgen from bazel_gomock, this is what we found besides what @codyoss said above:
|
We use source mode for interfaces in our repository and reflect mode for interfaces in dependencies. |
We've migrated from src to reflection in Please for a couple of reasons:
|
## Description Fix the mockgen build tags across the board ## Issue ![Screenshot 2023-05-16 at 4 51 23 PM](https://github.com/pokt-network/pocket/assets/1892194/b22c3e73-c9fb-4a72-a9b9-531df7506044) ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [x] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Using `source mode` instead of `reflect mode` across all mocked interfaces for consistency and verbosity; more detailed [here](golang/mock#406) - Fixed a few copy-pasta path-related issues (interface names and mock destinations) - Fixed Makefile targets related to mock cleanups ## Testing - [x] `make develop_test`; if any code changes were made - [ ] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) - [ ] I have tested my changes using the available tooling - [ ] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [ ] I have updated the corresponding README(s); local and/or global - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
Requested feature
Document why a user should choose the source or reflect mode.
Why the feature is needed
The README states:
The CLI help states:
Neither explains which mode a user should choose. Is one faster than the other? Is one more reliable? Are they the same? If so, why do both exist?
This is a follow up issue as requested in #36 (comment)
The text was updated successfully, but these errors were encountered: