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:
Herbie Ong 2019-04-09 23:11:47 -07:00
parent 09b5b46567
commit 89193ac602

View File

@ -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()
}