mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-18 13:11:16 +00:00
encoding/jsonpb: remove dependency on descriptor proto
Keeping this consistent with textpb - golang.org/cl/168439. Change-Id: Ie4c57615f4ac5eaf6b3836edaf7ae2082ebaae64 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/171240 Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
09b5b46567
commit
89193ac602
@ -15,8 +15,6 @@ import (
|
||||
"github.com/golang/protobuf/v2/proto"
|
||||
pref "github.com/golang/protobuf/v2/reflect/protoreflect"
|
||||
"github.com/golang/protobuf/v2/reflect/protoregistry"
|
||||
|
||||
descpb "github.com/golang/protobuf/v2/types/descriptor"
|
||||
)
|
||||
|
||||
// Marshal writes the given proto.Message in JSON format using default options.
|
||||
@ -337,13 +335,6 @@ func isMessageSetExtension(xt pref.ExtensionType) bool {
|
||||
if xt.FullName().Parent() != mt.FullName() {
|
||||
return false
|
||||
}
|
||||
xmt := xt.ExtendedType()
|
||||
if xmt.Fields().Len() != 0 {
|
||||
return false
|
||||
}
|
||||
opt := xmt.Options().(*descpb.MessageOptions)
|
||||
if opt == nil {
|
||||
return false
|
||||
}
|
||||
return opt.GetMessageSetWireFormat()
|
||||
xmt, ok := xt.ExtendedType().(interface{ IsMessageSet() bool })
|
||||
return ok && xmt.IsMessageSet()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user