protobuf-go/reflect
Joe Tsai 2f68590cf0 reflect/prototype: use proto2 syntax for standalone extension fields
Without resolving the question of whether an extension field is always proto2
or sometimes proto3, just make it impossible to construct a standalone extension
field of the proto3 syntax.

By dropping the syntax field from the constructor, we can just assume that the
syntax is always proto2. There is no benefit for creating a proto3 standalone
extension, so there is no loss of functionality.

In the unlikely future where there needs to be distinction, we can add the field
back into the descriptor. The zero value of protoreflect.Syntax is invalid,
so we can determine if the user did not set that field.

Change-Id: Ie93fa55de96f29553fb04ff6649bbea79a144407
Reviewed-on: https://go-review.googlesource.com/c/144279
Reviewed-by: Damien Neil <dneil@google.com>
2018-10-24 17:35:49 +00:00
..
protoreflect reflect/protoreflect: add Descriptor.Options method 2018-10-23 23:44:11 +00:00
protoregistry go.mod: rename google.golang.org/proto as github.com/golang/protobuf/v2 2018-09-24 16:11:50 +00:00
prototype reflect/prototype: use proto2 syntax for standalone extension fields 2018-10-24 17:35:49 +00:00