Skip to content
Branch: master
Commits on May 14, 2019
  1. encoding: switch ordering of Unmarshal arguments

    dsnet committed May 14, 2019
    While it is general convention that the receiver being mutated
    is the first argument, the standard library specifically goes against
    this convention when it comes to the Unmarshal function.
    Switch the ordering of the Unmarshal function to match the Go stdlib.
    Change-Id: I893346680233ef9fec7104415a54a0a7ae353378
    Reviewed-by: Damien Neil <>
  2. reflect/protoreflect: add helper methods to FieldDescriptor

    dsnet committed May 13, 2019
    Added API:
    Deprecated API (to be removed in subsequent CL):
    These methods help cleanup several common usage patterns.
    Change-Id: I9a3ffabc2edb2173c536509b22f330f98bba7cf3
    Reviewed-by: Damien Neil <>
Commits on May 13, 2019
  1. reflect/protoreflect: add Descriptor.ParentFile

    dsnet committed May 12, 2019
    Querying for the parent file that contains a descriptor declaration
    is a common enough operation to warrant its own first-class method.
    Change-Id: I2f41e5126a5b465df23897904a6513dd3ed8dd92
    Reviewed-by: Damien Neil <>
  2. reflect/protoreflect: add Descriptor specific methods

    dsnet committed May 1, 2019
    Added methods:
    All functionality is switched over to use those methods instead of
    implicitly relying on the fact that {Enum,Message}Type implicitly
    implement the associated descriptor interface.
    This CL does not yet remove {Enum,Message}.Type or prevent
    {Enum,Message,Extension}Type from implementating a descriptor.
    That is a subsequent CL.
    The Message.New method is also added to replace functionality
    that will be lost when the Type methods are removed.
    Change-Id: I7fefde1673bbd40bfdac489aca05cec9a6c98eb1
    Reviewed-by: Damien Neil <>
    Reviewed-by: Herbie Ong <>
Commits on May 9, 2019
  1. internal/impl: remove ExtensionFieldV1.Raw

    dsnet committed May 7, 2019
    CL/175579 switches v2 to use XXX_unrecognized exclusively.
    CL/175838 switches v1 to use XXX_unrecognized exclusively.
    This means that it is now safe to delete the Raw field.
    Change-Id: Ic60c58147c2df4078e72c34d1202d226a7ea4bed
    Reviewed-by: Damien Neil <>
  2. internal/impl: use XXX_unrecognized exclusively for unknown fields

    dsnet committed May 7, 2019
    The protobuf data model makes no distinction between unknown fields
    that are within the extension field ranges or not. Now that we eagerly
    unmarshal extensions, there is even less need for storing unknown
    fields in the extension map. Instead, use the XXX_unrecognized field
    exclusively for this purpose.
    Change-Id: I673a7d6259fe9fdbdc295bcfa8252ef4da415343
    Reviewed-by: Damien Neil <>
  3. proto: eagerly unmarshal extensions

    dsnet committed May 7, 2019
    CL/172399 switches the v1 code to eagerly unmarshal extensions.
    This CL does the equivalent for v2.
    For the test, we simply switch from protoV1.Equal to protoV2.Equal,
    since the v2 equal does not magically unmarshal raw extensions.
    Change-Id: I6f64455b0a75bbc9a9a82108558641a29bd2b982
    Reviewed-by: Damien Neil <>
Commits on May 7, 2019
  1. internal/encoding/wire: increase maximum field number

    dsnet committed May 7, 2019
    The protobuf documentation explicitly specifies (1<<29)-1 as the maximum
    field number, but the C++ implementation itself has a special-case where it
    allows field numbers up to MaxInt32 for MessageSet fields, but continues
    to apply the former limit in all non-MessageSet cases.
    To avoid complicated branching logic, we use the larger limit for all cases
    if MessageSet is supported, otherwise, we impose the documented limit.
    Change-Id: I710a2a21aa3beba161c3e6ca2f2ed9a266920a5a
    Reviewed-by: Damien Neil <>
You can’t perform that action at this time.