Closed Abhishekkarunakaran closed 1 month ago
Is there any particular reason to make it as what it is now?
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.
In my understanding, the relative path is only available in reflect mode, not in source mode.
In Windows, to avoid passing the full path like -source=D:\go_project\library_management\src\core\ports\repository.go
you can pass the relative path between quotes like this -source="src/core/ports/repository.go"
.
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.