This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Best effort guesses for output package path (#547)
I know we need output package path to avoid self-importing. However, this only happens when the mock is output into an already existing package, in which case the caller is responsible for passing -self_package. Without -self_package, guessing output package path should be on best effort basis. There is no requirement for destination to be in a Go module or GOPATH (in fact, it's hard, if possible at all, to do so in Bazel). So parsePackageImport(dstPath) often fails. Such failure should not fail the main program. We should instead be optimistic and leave output package package empty, assuming no self importing would happen.
- Loading branch information