Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -1,27 +1,20 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: importduplicate.proto
/*
Package importduplicate is a generated protocol buffer package.
It is generated from these files:
importduplicate.proto
It has these top-level messages:
MapAndSortKeys
*/
package importduplicate
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import sortkeys "github.com/gogo/protobuf/test/importduplicate/sortkeys"
import proto1 "github.com/gogo/protobuf/test/importduplicate/proto"
import sortkeys "github.com/gogo/protobuf/test/importduplicate/sortkeys"
import bytes "bytes"
import strings "strings"
import reflect "reflect"
import sortkeys1 "github.com/gogo/protobuf/sortkeys"
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -35,15 +28,37 @@ var _ = math.Inf
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type MapAndSortKeys struct {
Key *sortkeys.Object `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
KeyValue map[int32]string `protobuf:"bytes,2,rep,name=keyValue" json:"keyValue,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Value *proto1.Subject `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
Key *sortkeys.Object `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
KeyValue map[int32]string `protobuf:"bytes,2,rep,name=keyValue" json:"keyValue,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Value *proto1.Subject `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MapAndSortKeys) Reset() { *m = MapAndSortKeys{} }
func (m *MapAndSortKeys) String() string { return proto.CompactTextString(m) }
func (*MapAndSortKeys) ProtoMessage() {}
func (*MapAndSortKeys) Descriptor() ([]byte, []int) { return fileDescriptorImportduplicate, []int{0} }
func (m *MapAndSortKeys) Reset() { *m = MapAndSortKeys{} }
func (m *MapAndSortKeys) String() string { return proto.CompactTextString(m) }
func (*MapAndSortKeys) ProtoMessage() {}
func (*MapAndSortKeys) Descriptor() ([]byte, []int) {
return fileDescriptor_importduplicate_e9d46e93914bce47, []int{0}
}
func (m *MapAndSortKeys) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MapAndSortKeys.Unmarshal(m, b)
}
func (m *MapAndSortKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MapAndSortKeys.Marshal(b, m, deterministic)
}
func (dst *MapAndSortKeys) XXX_Merge(src proto.Message) {
xxx_messageInfo_MapAndSortKeys.Merge(dst, src)
}
func (m *MapAndSortKeys) XXX_Size() int {
return xxx_messageInfo_MapAndSortKeys.Size(m)
}
func (m *MapAndSortKeys) XXX_DiscardUnknown() {
xxx_messageInfo_MapAndSortKeys.DiscardUnknown(m)
}
var xxx_messageInfo_MapAndSortKeys proto.InternalMessageInfo
func (m *MapAndSortKeys) GetKey() *sortkeys.Object {
if m != nil {
@@ -68,6 +83,7 @@ func (m *MapAndSortKeys) GetValue() *proto1.Subject {
func init() {
proto.RegisterType((*MapAndSortKeys)(nil), "importduplicate.MapAndSortKeys")
proto.RegisterMapType((map[int32]string)(nil), "importduplicate.MapAndSortKeys.KeyValueEntry")
}
func (this *MapAndSortKeys) Equal(that interface{}) bool {
if that == nil {
@@ -102,6 +118,9 @@ func (this *MapAndSortKeys) Equal(that interface{}) bool {
if !this.Value.Equal(that1.Value) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *MapAndSortKeys) GoString() string {
@@ -117,7 +136,7 @@ func (this *MapAndSortKeys) GoString() string {
for k := range this.KeyValue {
keysForKeyValue = append(keysForKeyValue, k)
}
sortkeys1.Int32s(keysForKeyValue)
github_com_gogo_protobuf_sortkeys.Int32s(keysForKeyValue)
mapStringForKeyValue := "map[int32]string{"
for _, k := range keysForKeyValue {
mapStringForKeyValue += fmt.Sprintf("%#v: %#v,", k, this.KeyValue[k])
@@ -129,6 +148,9 @@ func (this *MapAndSortKeys) GoString() string {
if this.Value != nil {
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
@@ -156,6 +178,7 @@ func NewPopulatedMapAndSortKeys(r randyImportduplicate, easy bool) *MapAndSortKe
this.Value = proto1.NewPopulatedSubject(r, easy)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedImportduplicate(r, 4)
}
return this
}
@@ -233,9 +256,11 @@ func encodeVarintPopulateImportduplicate(dAtA []byte, v uint64) []byte {
return dAtA
}
func init() { proto.RegisterFile("importduplicate.proto", fileDescriptorImportduplicate) }
func init() {
proto.RegisterFile("importduplicate.proto", fileDescriptor_importduplicate_e9d46e93914bce47)
}
var fileDescriptorImportduplicate = []byte{
var fileDescriptor_importduplicate_e9d46e93914bce47 = []byte{
// 277 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcc, 0x2d, 0xc8,
0x2f, 0x2a, 0x49, 0x29, 0x2d, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f,

View File

@@ -1,28 +1,20 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: importduplicate.proto
/*
Package importduplicate is a generated protocol buffer package.
It is generated from these files:
importduplicate.proto
It has these top-level messages:
MapAndSortKeys
*/
package importduplicate
import testing "testing"
import rand "math/rand"
import math_rand "math/rand"
import time "time"
import proto "github.com/gogo/protobuf/proto"
import jsonpb "github.com/gogo/protobuf/jsonpb"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb"
import fmt "fmt"
import parser "go/parser"
import go_parser "go/parser"
import proto "github.com/gogo/protobuf/proto"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/gogo/protobuf/test/importduplicate/sortkeys"
import _ "github.com/gogo/protobuf/test/importduplicate/proto"
import _ "github.com/gogo/protobuf/test/importduplicate/sortkeys"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -31,14 +23,14 @@ var _ = math.Inf
func TestMapAndSortKeysProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedMapAndSortKeys(popr, false)
dAtA, err := proto.Marshal(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &MapAndSortKeys{}
if err := proto.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
@@ -56,21 +48,21 @@ func TestMapAndSortKeysProto(t *testing.T) {
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = proto.Unmarshal(littlefuzz, msg)
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestMapAndSortKeysJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedMapAndSortKeys(popr, true)
marshaler := jsonpb.Marshaler{}
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &MapAndSortKeys{}
err = jsonpb.UnmarshalString(jsondata, msg)
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -80,11 +72,11 @@ func TestMapAndSortKeysJSON(t *testing.T) {
}
func TestMapAndSortKeysProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedMapAndSortKeys(popr, true)
dAtA := proto.MarshalTextString(p)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &MapAndSortKeys{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -94,11 +86,11 @@ func TestMapAndSortKeysProtoText(t *testing.T) {
func TestMapAndSortKeysProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedMapAndSortKeys(popr, true)
dAtA := proto.CompactTextString(p)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &MapAndSortKeys{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -107,14 +99,14 @@ func TestMapAndSortKeysProtoCompactText(t *testing.T) {
}
func TestMapAndSortKeysGoString(t *testing.T) {
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedMapAndSortKeys(popr, false)
s1 := p.GoString()
s2 := fmt.Sprintf("%#v", p)
if s1 != s2 {
t.Fatalf("GoString want %v got %v", s1, s2)
}
_, err := parser.ParseExpr(s1)
_, err := go_parser.ParseExpr(s1)
if err != nil {
t.Fatal(err)
}

View File

@@ -1,27 +1,20 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/proto.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
proto/proto.proto
It has these top-level messages:
Subject
*/
package proto
import proto1 "github.com/gogo/protobuf/proto"
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import bytes "bytes"
import strings "strings"
import reflect "reflect"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto1.Marshal
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -29,18 +22,40 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto1.GoGoProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Subject struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Subject) Reset() { *m = Subject{} }
func (m *Subject) String() string { return proto1.CompactTextString(m) }
func (*Subject) ProtoMessage() {}
func (*Subject) Descriptor() ([]byte, []int) { return fileDescriptorProto, []int{0} }
func (m *Subject) Reset() { *m = Subject{} }
func (m *Subject) String() string { return proto.CompactTextString(m) }
func (*Subject) ProtoMessage() {}
func (*Subject) Descriptor() ([]byte, []int) {
return fileDescriptor_proto_2eb405ba8c57e5a9, []int{0}
}
func (m *Subject) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Subject.Unmarshal(m, b)
}
func (m *Subject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Subject.Marshal(b, m, deterministic)
}
func (dst *Subject) XXX_Merge(src proto.Message) {
xxx_messageInfo_Subject.Merge(dst, src)
}
func (m *Subject) XXX_Size() int {
return xxx_messageInfo_Subject.Size(m)
}
func (m *Subject) XXX_DiscardUnknown() {
xxx_messageInfo_Subject.DiscardUnknown(m)
}
var xxx_messageInfo_Subject proto.InternalMessageInfo
func init() {
proto1.RegisterType((*Subject)(nil), "proto.Subject")
proto.RegisterType((*Subject)(nil), "proto.Subject")
}
func (this *Subject) Equal(that interface{}) bool {
if that == nil {
@@ -61,6 +76,9 @@ func (this *Subject) Equal(that interface{}) bool {
} else if this == nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Subject) GoString() string {
@@ -69,6 +87,9 @@ func (this *Subject) GoString() string {
}
s := make([]string, 0, 4)
s = append(s, "&proto.Subject{")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
@@ -83,6 +104,7 @@ func valueToGoStringProto(v interface{}, typ string) string {
func NewPopulatedSubject(r randyProto, easy bool) *Subject {
this := &Subject{}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedProto(r, 1)
}
return this
}
@@ -160,9 +182,9 @@ func encodeVarintPopulateProto(dAtA []byte, v uint64) []byte {
return dAtA
}
func init() { proto1.RegisterFile("proto/proto.proto", fileDescriptorProto) }
func init() { proto.RegisterFile("proto/proto.proto", fileDescriptor_proto_2eb405ba8c57e5a9) }
var fileDescriptorProto = []byte{
var fileDescriptor_proto_2eb405ba8c57e5a9 = []byte{
// 103 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2c, 0x28, 0xca, 0x2f,
0xc9, 0xd7, 0x07, 0x93, 0x7a, 0x60, 0x52, 0x88, 0x15, 0x4c, 0x49, 0xe9, 0xa6, 0x67, 0x96, 0x64,

View File

@@ -1,42 +1,34 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/proto.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
proto/proto.proto
It has these top-level messages:
Subject
*/
package proto
import testing "testing"
import rand "math/rand"
import math_rand "math/rand"
import time "time"
import proto1 "github.com/gogo/protobuf/proto"
import jsonpb "github.com/gogo/protobuf/jsonpb"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb"
import fmt "fmt"
import parser "go/parser"
import go_parser "go/parser"
import proto "github.com/gogo/protobuf/proto"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto1.Marshal
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func TestSubjectProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedSubject(popr, false)
dAtA, err := proto1.Marshal(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &Subject{}
if err := proto1.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
@@ -54,21 +46,21 @@ func TestSubjectProto(t *testing.T) {
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = proto1.Unmarshal(littlefuzz, msg)
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestSubjectJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedSubject(popr, true)
marshaler := jsonpb.Marshaler{}
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &Subject{}
err = jsonpb.UnmarshalString(jsondata, msg)
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -78,11 +70,11 @@ func TestSubjectJSON(t *testing.T) {
}
func TestSubjectProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedSubject(popr, true)
dAtA := proto1.MarshalTextString(p)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &Subject{}
if err := proto1.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -92,11 +84,11 @@ func TestSubjectProtoText(t *testing.T) {
func TestSubjectProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedSubject(popr, true)
dAtA := proto1.CompactTextString(p)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &Subject{}
if err := proto1.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -105,14 +97,14 @@ func TestSubjectProtoCompactText(t *testing.T) {
}
func TestSubjectGoString(t *testing.T) {
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedSubject(popr, false)
s1 := p.GoString()
s2 := fmt.Sprintf("%#v", p)
if s1 != s2 {
t.Fatalf("GoString want %v got %v", s1, s2)
}
_, err := parser.ParseExpr(s1)
_, err := go_parser.ParseExpr(s1)
if err != nil {
t.Fatal(err)
}

View File

@@ -1,15 +1,6 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: sortkeys/sortable.proto
/*
Package sortkeys is a generated protocol buffer package.
It is generated from these files:
sortkeys/sortable.proto
It has these top-level messages:
Object
*/
package sortkeys
import proto "github.com/gogo/protobuf/proto"
@@ -17,6 +8,8 @@ import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import bytes "bytes"
import strings "strings"
import reflect "reflect"
@@ -32,12 +25,34 @@ var _ = math.Inf
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Object struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Object) Reset() { *m = Object{} }
func (m *Object) String() string { return proto.CompactTextString(m) }
func (*Object) ProtoMessage() {}
func (*Object) Descriptor() ([]byte, []int) { return fileDescriptorSortable, []int{0} }
func (m *Object) Reset() { *m = Object{} }
func (m *Object) String() string { return proto.CompactTextString(m) }
func (*Object) ProtoMessage() {}
func (*Object) Descriptor() ([]byte, []int) {
return fileDescriptor_sortable_d1adc3e2593f24f3, []int{0}
}
func (m *Object) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Object.Unmarshal(m, b)
}
func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Object.Marshal(b, m, deterministic)
}
func (dst *Object) XXX_Merge(src proto.Message) {
xxx_messageInfo_Object.Merge(dst, src)
}
func (m *Object) XXX_Size() int {
return xxx_messageInfo_Object.Size(m)
}
func (m *Object) XXX_DiscardUnknown() {
xxx_messageInfo_Object.DiscardUnknown(m)
}
var xxx_messageInfo_Object proto.InternalMessageInfo
func init() {
proto.RegisterType((*Object)(nil), "sortkeys.Object")
@@ -61,6 +76,9 @@ func (this *Object) Equal(that interface{}) bool {
} else if this == nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Object) GoString() string {
@@ -69,6 +87,9 @@ func (this *Object) GoString() string {
}
s := make([]string, 0, 4)
s = append(s, "&sortkeys.Object{")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
@@ -83,6 +104,7 @@ func valueToGoStringSortable(v interface{}, typ string) string {
func NewPopulatedObject(r randySortable, easy bool) *Object {
this := &Object{}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedSortable(r, 1)
}
return this
}
@@ -160,9 +182,9 @@ func encodeVarintPopulateSortable(dAtA []byte, v uint64) []byte {
return dAtA
}
func init() { proto.RegisterFile("sortkeys/sortable.proto", fileDescriptorSortable) }
func init() { proto.RegisterFile("sortkeys/sortable.proto", fileDescriptor_sortable_d1adc3e2593f24f3) }
var fileDescriptorSortable = []byte{
var fileDescriptor_sortable_d1adc3e2593f24f3 = []byte{
// 115 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0xce, 0x2f, 0x2a,
0xc9, 0x4e, 0xad, 0x2c, 0xd6, 0x07, 0x31, 0x12, 0x93, 0x72, 0x52, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b,

View File

@@ -1,24 +1,16 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: sortkeys/sortable.proto
/*
Package sortkeys is a generated protocol buffer package.
It is generated from these files:
sortkeys/sortable.proto
It has these top-level messages:
Object
*/
package sortkeys
import testing "testing"
import rand "math/rand"
import math_rand "math/rand"
import time "time"
import proto "github.com/gogo/protobuf/proto"
import jsonpb "github.com/gogo/protobuf/jsonpb"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb"
import fmt "fmt"
import parser "go/parser"
import go_parser "go/parser"
import proto "github.com/gogo/protobuf/proto"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
@@ -29,14 +21,14 @@ var _ = math.Inf
func TestObjectProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedObject(popr, false)
dAtA, err := proto.Marshal(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &Object{}
if err := proto.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
@@ -54,21 +46,21 @@ func TestObjectProto(t *testing.T) {
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = proto.Unmarshal(littlefuzz, msg)
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestObjectJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedObject(popr, true)
marshaler := jsonpb.Marshaler{}
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &Object{}
err = jsonpb.UnmarshalString(jsondata, msg)
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -78,11 +70,11 @@ func TestObjectJSON(t *testing.T) {
}
func TestObjectProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedObject(popr, true)
dAtA := proto.MarshalTextString(p)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &Object{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -92,11 +84,11 @@ func TestObjectProtoText(t *testing.T) {
func TestObjectProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedObject(popr, true)
dAtA := proto.CompactTextString(p)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &Object{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -105,14 +97,14 @@ func TestObjectProtoCompactText(t *testing.T) {
}
func TestObjectGoString(t *testing.T) {
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedObject(popr, false)
s1 := p.GoString()
s2 := fmt.Sprintf("%#v", p)
if s1 != s2 {
t.Fatalf("GoString want %v got %v", s1, s2)
}
_, err := parser.ParseExpr(s1)
_, err := go_parser.ParseExpr(s1)
if err != nil {
t.Fatal(err)
}