Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative path as parameter values for -source and -destination #174

Open
Abhishekkarunakaran opened this issue Apr 22, 2024 · 3 comments
Open

Comments

@Abhishekkarunakaran
Copy link

Currently we have to pass the whole path of the files as values to the flags -source and -destination.
eg:
mockgen -source=D:\go_project\library_management\src\core\ports\repository.go -destination=D:\go_project\library_management\src\core\mocks\respository_mock.go
(In windows)

To reduce this redundancy in type, we can use the relative path.
Assuming mockgen is used from the targeted codebase.

@Abhishekkarunakaran
Copy link
Author

Is there any particular reason to make it as what it is now?

@r-hang
Copy link
Contributor

r-hang commented Apr 23, 2024

Hey @Abhishekkarunakaran, I see examples of relative paths being passed to the --source and --destination options for the mockgen command in the //go:generate comments of multiple files in the repository.

@Abhishekkarunakaran
Copy link
Author

In my understanding, the relative path is only available in reflect mode, not in source mode.

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

No branches or pull requests

2 participants