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

Look up enum value maps by their proto name #315

Merged
merged 3 commits into from
Feb 24, 2017

Commits on Feb 23, 2017

  1. Configuration menu
    Copy the full SHA
    bdce4a7 View commit details
    Browse the repository at this point in the history
  2. runtime: Make enum type distinct for query test

    This also means that the reflect-based name tests will now fail. This
    is intentional, we want to use the protobuf enum's name to look it up
    via proto.EnumValueMap, not the reflect-based type name, since that can
    vary.
    nilium committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    e98d5db View commit details
    Browse the repository at this point in the history
  3. runtime: Use protobuf enum name instead of (reflect.Type).String

    This adds pass-through of the *proto.Properties for fields so that the
    fields being populated can be addressed by their enum name when the
    type is an enum (i.e., (*proto.Properties).Enum is set).
    
    As a result of this, the tests now pass, using the protobuf enum name
    as registered (i.e., fully qualified package name) instead of the Go
    package name derived by calling (reflect.Type).String. This should have
    no real impact on existing use, but it may be justified to re-add
    a fallback case for that reflect.Type name for hand-written protobuf
    types. Even then, however, it seems unlikely that it should be expected
    for enums-by-name to work when registering the enum map under a name
    other than the one it's referred to in protobuf.
    nilium committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    479142a View commit details
    Browse the repository at this point in the history