forked from vektra/mockery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aggresively refactor import generation
The Generator now eagerly goes through all types used in methods of the interface to be mocked and performs a lookup of to ensure that all package import names are unique. This fixes support for imports that are needed for methods coming from a nested interface whose names conflict with imports coming from the main interface or other nested interfaces. Fixes: vektra#94
- Loading branch information
1 parent
fb563f2
commit 97a72e5
Showing
4 changed files
with
154 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package test | ||
|
||
import ( | ||
"github.com/vektra/mockery/mockery/fixtures/http" | ||
) | ||
|
||
type HasConflictingNestedImports interface { | ||
RequesterNS | ||
Z() http.MyStruct | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.