Skip to content
Permalink
Branch: master
Commits on Oct 9, 2019
  1. internal/impl: print <nil> for typed nil messages

    dsnet committed Oct 6, 2019
    The Message.String method is intended for debugging,
    so outputting <nil> for typed nil messages actually has use.
    This matches the current behavior of Message.String
    for messages generated by the v1 protoc-gen-go.
    
    Change-Id: I6e31183961c83d7bce6338eb99aa7758cfda1ff4
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/199397
    Reviewed-by: Damien Neil <dneil@google.com>
Commits on Oct 6, 2019
  1. reflect/protoregistry: protect global registries with a lock

    dsnet committed Oct 4, 2019
    The global registry is initialized via generated code.
    The Go language guarantees that these are serialized (non concurrently).
    The main concern is when a concurrent read operation occurs while
    registration is still ongoing. In such a case, we do need a lock to
    serialize the read with regard to the writes (i.e. registrations).
    
    Change-Id: Ied35d6f8d2620f448cb281c3ec46d8de893b5671
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/199217
    Reviewed-by: Damien Neil <dneil@google.com>
Commits on Oct 5, 2019
  1. internal/protolegacy: add stub v1 proto package for testing purposes

    dsnet committed Oct 5, 2019
    The protolegacy package is a minimal version of the v1 proto package.
    This allows us to use this stub version as the dependency for
    internal/testprotos/legacy packages and avoid a dependency
    on the real v1 proto package.
    
    The implementation of most v1 functionality will panic if called.
    This way, we know if we the v2 code depends on one of those
    unimplemented functions.
    
    Updates golang/protobuf#962
    
    Change-Id: I20b4091706fd456e4b01ae0931cce30a872639b0
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/199297
    Reviewed-by: Damien Neil <dneil@google.com>
You can’t perform that action at this time.