Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

setting default package name when self_package is known #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

linzhp
Copy link
Contributor

@linzhp linzhp commented Sep 23, 2019

When self_package is passed, it is possible to infer package name parameter so users don't need to pass duplicate information

@jmhodges
Copy link
Owner

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

@linzhp
Copy link
Contributor Author

linzhp commented Oct 23, 2019

I agree with #28 (comment), 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

@linzhp
Copy link
Contributor Author

linzhp commented Jan 7, 2020

@jmhodges Any more concerns on this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants