After https://github.com/golang/mock/pull/420, GoMock source mode no longer requires full transitive dependency closure in GOPATH. As a result, the gomock rule can avoid calling the gopath rule, it only need to make sure the source file and auxiliary files in the GOPATH.
After https://github.com/golang/mock/pull/420, GoMock source mode no longer requires full transitive dependency closure in GOPATH. As a result, the gomock rule can avoid calling the
gopath
rule, it only need to make sure the source file and auxiliary files in the GOPATH.When building
//gomock:mocks
from https://github.com/linzhp/bazel_examples/commit/b7f4b75098d22e604540a87e4eaa3877de46aa9d, bazel_gomock (4f2ee840432b1a08ccc46ee4f2c1f5a2bad8fade) spent 2.287 seconds on gomock rule:After applying this patch, it became 1.498 seconds:
The difference would be more significant for packages with large dependency tree