-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: define imported package's local name by using flags (#41)
fixes [#646](golang/mock#646), Hi, my friends. Merging this pull request can fix old bugs related to defining the local names of imported packages by using the -imports flag. I have also added a test for that, and it works properly. If you have any ideas or concerns regarding the PR, feel free to tell me. --------- Co-authored-by: Erfan Momeni <[email protected]> Co-authored-by: n0trace <[email protected]> Co-authored-by: utagawa kiki <[email protected]> Co-authored-by: Sung Yoon Whang <[email protected]>
- Loading branch information
1 parent
89f1565
commit 2417c65
Showing
4 changed files
with
99 additions
and
7 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,13 @@ | ||
package defined_import_local_name | ||
|
||
import ( | ||
"bytes" | ||
"context" | ||
) | ||
|
||
//go:generate mockgen -package defined_import_local_name -destination mock.go -source input.go -imports b_mock=bytes,c_mock=context | ||
|
||
type WithImports interface { | ||
Method1() bytes.Buffer | ||
Method2() context.Context | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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