Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AllowUnexportedWithinModule #116

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

Support AllowUnexportedWithinModule #116

wants to merge 1 commit into from

Commits on Feb 26, 2019

  1. Support AllowUnexportedWithinModule

    For sufficiently large codebases with many struct types defined,
    it is untenable to specify a large list of all types in the repository
    that AllowUnexported permits visibility for.
    
    In Go, we observe that code with a shared owner often lives in the same
    repository, and all sub-packages within a repository often share a common
    package path prefix. Thus, permit expressing visibility allowances in terms
    of package path prefixes instead of individual types.
    
    While not explicitly documented, this feature allows the universal comparing
    of unexported fields on all types:
    	cmp.Equal(x, y, cmp.AllowUnexportedWithinModule(""))
    
    This "feature" is intentionally undocumented (but a natural side-effect of the
    expressed behavior of PackagePrefix) since it considered to be bad practice.
    dsnet committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    a823945 View commit details
    Browse the repository at this point in the history