Closed bstncartwright closed 3 weeks ago
I'm not a maintainer; I reported the bug.
I like the fix. Name collisions have always been possible: they didn't happen so much because "arg0"..."arg5" are not usual package names.
How about using this as a suffix rather than a full replacement?
DoThat(internalpackage int)
: instead of becoming
-func (m *MockMything) DoThat(arg0 int) internalpackage.FooExported {
+func (m *MockMything) DoThat(internalpackage_arg0 int) internalpackage.FooExported {
this way we still get the v0.5.0 feature that provides human readable names when using mocks in all cases.
I'm not a maintainer; I reported the bug.
I like the fix. Name collisions have always been possible: they didn't happen so much because "arg0"..."arg5" are not usual package names. How about using this as a suffix rather than a full replacement?
DoThat(internalpackage int)
: instead of becoming-func (m *MockMything) DoThat(arg0 int) internalpackage.FooExported { +func (m *MockMything) DoThat(internalpackage_arg0 int) internalpackage.FooExported {
this way we still get the v0.5.0 feature that provides human readable names when using mocks in all cases.
Interesting, I like that idea but I wonder if it could cause more confusion. Auto-complete from the LSP could show internalpackage_arg0
and the developer might think it is an argument of that package? Just a thought, I am open to finding the best answer here!
Added a comment. Also, could you re-generate existing test mocks?
Done. Thanks for your review!
@tchung1118 can we expect a new patch/minor release for this fix anytime soon?
Resolves #218
This is my first time contributing to this project, please let me know if there is anything I need to change. Thanks!