mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-10 07:14:24 +00:00
reflect/prototype: default proto file syntax is "proto2"
protoc leaves FileDescriptorProto.Syntax unset when the syntax is "proto2". Change-Id: Id1370145fc9c5c67344f5a998d118fd0f9f65f24 Reviewed-on: https://go-review.googlesource.com/133636 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
d901677135
commit
ef18063941
@ -55,7 +55,7 @@ import (
|
||||
func NewFileFromDescriptorProto(fd *descriptorV1.FileDescriptorProto, r *protoregistry.Files) (protoreflect.FileDescriptor, error) {
|
||||
var f File
|
||||
switch fd.GetSyntax() {
|
||||
case "proto2":
|
||||
case "", "proto2":
|
||||
f.Syntax = protoreflect.Proto2
|
||||
case "proto3":
|
||||
f.Syntax = protoreflect.Proto3
|
||||
|
Loading…
x
Reference in New Issue
Block a user