本文整理匯總了Golang中github.com/gogo/protobuf/proto.CompactTextString函數的典型用法代碼示例。如果您正苦於以下問題:Golang CompactTextString函數的具體用法?Golang CompactTextString怎麽用?Golang CompactTextString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CompactTextString函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestSizeMessageProtoCompactText
func TestSizeMessageProtoCompactText(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedSizeMessage(popr, true)
data := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &SizeMessage{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil {
panic(err)
}
if !p.Equal(msg) {
t.Fatalf("%#v !Proto %#v", msg, p)
}
}
示例2: TestBarProtoCompactText
func TestBarProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedBar(popr, true)
data := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &Bar{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
示例3: TestRepeatedNonNullableExternalStructProtoCompactText
func TestRepeatedNonNullableExternalStructProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedRepeatedNonNullableExternalStruct(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &RepeatedNonNullableExternalStruct{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
示例4: TestOperation_ExpungeProtoCompactText
func TestOperation_ExpungeProtoCompactText(t *testing16.T) {
popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano()))
p := NewPopulatedOperation_Expunge(popr, true)
data := github_com_gogo_protobuf_proto9.CompactTextString(p)
msg := &Operation_Expunge{}
if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil {
panic(err)
}
if err := p.VerboseEqual(msg); err != nil {
t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err)
}
if !p.Equal(msg) {
t.Fatalf("%#v !Proto %#v", msg, p)
}
}
示例5: TestFloatingPointProtoCompactText
func TestFloatingPointProtoCompactText(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedFloatingPoint(popr, true)
data := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &FloatingPoint{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil {
panic(err)
}
if err := p.VerboseEqual(msg); err != nil {
t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err)
}
if !p.Equal(msg) {
t.Fatalf("%#v !Proto %#v", msg, p)
}
}
示例6: TestAllMapsOrderedProtoCompactText
func TestAllMapsOrderedProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedAllMapsOrdered(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &AllMapsOrdered{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if err := p.VerboseEqual(msg); err != nil {
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
示例7: TestRebalanceCheckResponseProtoCompactText
func TestRebalanceCheckResponseProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedRebalanceCheckResponse(popr, true)
data := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &RebalanceCheckResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if err := p.VerboseEqual(msg); err != nil {
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
示例8: String
func (m *Distribution_BucketOptions_Explicit) String() string { return proto.CompactTextString(m) }
示例9: String
func (m *FileSnapshot) String() string { return proto.CompactTextString(m) }
示例10: String
func (m *MetricDescriptor) String() string { return proto.CompactTextString(m) }
示例11: String
func (m *Simple) String() string { return proto.CompactTextString(m) }
示例12: String
func (m *StoreStatus) String() string { return proto.CompactTextString(m) }
示例13: String
func (m *SQLRequest_Cmd) String() string { return proto.CompactTextString(m) }
示例14: String
func (m *PrivilegeDescriptor) String() string { return proto.CompactTextString(m) }
示例15: String
func (m *Identify) String() string { return proto.CompactTextString(m) }