Skip to content

Commit 1ee46df

Browse files
committed
all: update v2 dependency to 20190620020611-d888139e7b59
This pulls in CL/182360 which splits protoimpl.FileBuilder into protoimpl.DescBuilder and protoimpl.TypeBuilder. Change-Id: Iddf7fcbf6aa32476f78199071fabc66b28167772 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/183100 Reviewed-by: Damien Neil <[email protected]>
1 parent f94016f commit 1ee46df

File tree

11 files changed

+187
-58
lines changed

11 files changed

+187
-58
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/golang/protobuf
22

33
go 1.9
44

5-
require google.golang.org/protobuf v0.0.0-20190617175724-bd7b7a9e0c26
5+
require google.golang.org/protobuf v0.0.0-20190620020611-d888139e7b59

go.sum

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ github.com/golang/protobuf v1.2.1-0.20190516201927-a2cd3ac1b343/go.mod h1:PScGDF
44
github.com/golang/protobuf v1.2.1-0.20190516215712-ae2eaafab405/go.mod h1:UmP8hhPKR5WWIjbT9v0JEVT+U0DBSjbW8KaZVeyFfRE=
55
github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4/go.mod h1:G+fNMoyvKWZDB7PCDHF+dXbH9OeE3+JoozCd9V7i66U=
66
github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba/go.mod h1:S1YIJXvYHGRCG2UmZsOcElkAYfvZLg2sDRr9+Xu8JXU=
7+
github.com/golang/protobuf v1.2.1-0.20190617175902-f94016f5239f/go.mod h1:G+HpKX7pYZAVkElkAWZkr08MToW6pTp/vs+E9osFfbg=
78
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
89
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
910
google.golang.org/protobuf v0.0.0-20190514172829-e89e6244e0e8/go.mod h1:791zQGC15vDqjpmPRn1uGPu5oHy/Jzw/Q1n5JsgIIcY=
@@ -12,5 +13,6 @@ google.golang.org/protobuf v0.0.0-20190516201745-40b83d67fc75/go.mod h1:jf+u8AHu
1213
google.golang.org/protobuf v0.0.0-20190516215540-a95b29fbf623/go.mod h1:cWWmz5lsCWIcqGLROrKq5Lu231IJw2PzqOZ8cgspbfY=
1314
google.golang.org/protobuf v0.0.0-20190522194032-21ade498bd69/go.mod h1:cJytyYi/6qdwy/+gD49hmgHcwD7zhWxE/1KPEslaZ3M=
1415
google.golang.org/protobuf v0.0.0-20190605195314-89d49632e5cf/go.mod h1:Btug4TBaP5wNYcb2zGKDTS7WMcaPPLuqEAKfEAZWYbo=
15-
google.golang.org/protobuf v0.0.0-20190617175724-bd7b7a9e0c26 h1:TNW9FO1kBCrRCRWMg37SPUITvx76qDVlAja8TSVvX4c=
1616
google.golang.org/protobuf v0.0.0-20190617175724-bd7b7a9e0c26/go.mod h1:+FOB8T5/Yw4ywwdyeun9/KlDeuwFYBkNQ+kVuwj9C94=
17+
google.golang.org/protobuf v0.0.0-20190620020611-d888139e7b59 h1:8413FO+8BbzBumkamWfo1VRHJyPBKBUeerQodlLbb0g=
18+
google.golang.org/protobuf v0.0.0-20190620020611-d888139e7b59/go.mod h1:of3pt14Y+dOxz2tBOHXEoapPpKFC15/0zWhPAddkfsU=

jsonpb/jsonpb_test.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package jsonpb
66

77
import (
88
"bytes"
9+
"compress/gzip"
910
"encoding/json"
1011
"io"
1112
"math"
@@ -17,6 +18,7 @@ import (
1718

1819
pb "github.com/golang/protobuf/jsonpb/jsonpb_test_proto"
1920
proto3pb "github.com/golang/protobuf/proto/proto3_proto"
21+
descriptorpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
2022
"github.com/golang/protobuf/ptypes"
2123
anypb "github.com/golang/protobuf/ptypes/any"
2224
durpb "github.com/golang/protobuf/ptypes/duration"
@@ -1046,6 +1048,10 @@ func (m *ptrFieldMessage) String() string {
10461048
func (m *ptrFieldMessage) ProtoMessage() {
10471049
}
10481050

1051+
func (m *ptrFieldMessage) Descriptor() ([]byte, []int) {
1052+
return testMessageFD, []int{0}
1053+
}
1054+
10491055
type stringField struct {
10501056
IsSet bool `protobuf:"varint,1,opt,name=isSet"`
10511057
StringValue string `protobuf:"bytes,2,opt,name=stringValue"`
@@ -1061,6 +1067,10 @@ func (s *stringField) String() string {
10611067
func (s *stringField) ProtoMessage() {
10621068
}
10631069

1070+
func (s *stringField) Descriptor() ([]byte, []int) {
1071+
return testMessageFD, []int{1}
1072+
}
1073+
10641074
func (s *stringField) UnmarshalJSONPB(jum *Unmarshaler, js []byte) error {
10651075
s.IsSet = true
10661076
s.StringValue = string(js)
@@ -1088,6 +1098,10 @@ func (m *dynamicMessage) String() string {
10881098
func (m *dynamicMessage) ProtoMessage() {
10891099
}
10901100

1101+
func (m *dynamicMessage) Descriptor() ([]byte, []int) {
1102+
return testMessageFD, []int{2}
1103+
}
1104+
10911105
func (m *dynamicMessage) MarshalJSONPB(jm *Marshaler) ([]byte, error) {
10921106
return []byte(m.RawJson), nil
10931107
}
@@ -1097,6 +1111,39 @@ func (m *dynamicMessage) UnmarshalJSONPB(jum *Unmarshaler, js []byte) error {
10971111
return nil
10981112
}
10991113

1114+
var testMessageFD = func() []byte {
1115+
fd := new(descriptorpb.FileDescriptorProto)
1116+
proto.UnmarshalText(`
1117+
name: "jsonpb.proto"
1118+
package: "github_com.golang.protobuf.jsonpb"
1119+
syntax: "proto3"
1120+
message_type: [{
1121+
name: "ptrFieldMessage"
1122+
field: [
1123+
{name:"stringField" number:1 label:LABEL_OPTIONAL type:TYPE_MESSAGE type_name:".github_com.golang.protobuf.jsonpb.stringField"}
1124+
]
1125+
}, {
1126+
name: "stringField"
1127+
field: [
1128+
{name:"isSet" number:1 label:LABEL_OPTIONAL type:TYPE_BOOL},
1129+
{name:"stringValue" number:2 label:LABEL_OPTIONAL type:TYPE_STRING}
1130+
]
1131+
}, {
1132+
name: "dynamicMessage"
1133+
field: [
1134+
{name:"rawJson" number:1 label:LABEL_OPTIONAL type:TYPE_BYTES},
1135+
{name:"dummy" number:2 label:LABEL_OPTIONAL type:TYPE_MESSAGE type_name:".github_com.golang.protobuf.jsonpb.dynamicMessage"}
1136+
]
1137+
}]
1138+
`, fd)
1139+
b, _ := proto.Marshal(fd)
1140+
var buf bytes.Buffer
1141+
zw := gzip.NewWriter(&buf)
1142+
zw.Write(b)
1143+
zw.Close()
1144+
return buf.Bytes()
1145+
}()
1146+
11001147
// Test unmarshaling message containing unset required fields should produce error.
11011148
func TestUnmarshalUnsetRequiredFields(t *testing.T) {
11021149
tests := []struct {

protoc-gen-go/descriptor/descriptor.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protoc-gen-go/plugin/plugin.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ptypes/any/any.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ptypes/duration/duration.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ptypes/empty/empty.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ptypes/struct/struct.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)