bazel_gomock
bazel_gomock copied to clipboard
setting default package name when self_package is known
When self_package is passed, it is possible to infer package name parameter so users don't need to pass duplicate information
Could you post the build target you're needing to use this in? I'm trying to figure out how this and #28 are operating differently
I agree with https://github.com/jmhodges/bazel_gomock/pull/28#issuecomment-543095961, this PR is different from #28. This is more for convenience. If we know the full package path via self_package, the package name can be deduced from that for most cases. It allows us to do something like:
gomock(
name = "private_mocks",
out = "mocks.go",
interfaces = [
"test",
],
library = ":go_default_library",
self_package = "github.com/josmad/go_samples/mock_test",
)
Note that package attribute is missing, and the rule uses mock_test by default
@jmhodges Any more concerns on this PR?