本文整理汇总了Golang中github.com/andres-erbsen/protobuf/proto.CompactTextString函数的典型用法代码示例。如果您正苦于以下问题:Golang CompactTextString函数的具体用法?Golang CompactTextString怎么用?Golang CompactTextString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CompactTextString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestFooProtoCompactText
func TestFooProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedFoo(popr, true)
data := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &Foo{}
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)
}
}
示例2: TestVerifierStateProtoCompactText
func TestVerifierStateProtoCompactText(t *testing.T) {
t.Skip()
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedVerifierState(popr, true)
data := github_com_andres_erbsen_protobuf_proto.CompactTextString(p)
msg := &VerifierState{}
if err := github_com_andres_erbsen_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)
}
}
示例3: TestOldWithGroup_Group2ProtoCompactText
func TestOldWithGroup_Group2ProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedOldWithGroup_Group2(popr, true)
data := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &OldWithGroup_Group2{}
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)
}
}
示例4: TestNothingProtoCompactText
func TestNothingProtoCompactText(t *testing.T) {
t.Skip()
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedNothing(popr, true)
data := github_com_andres_erbsen_protobuf_proto.CompactTextString(p)
msg := &Nothing{}
if err := github_com_andres_erbsen_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)
}
}
示例5: String
func (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) }
示例6: String
func (m *Widget) String() string { return proto.CompactTextString(m) }
示例7: String
func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
示例8: String
func (m *Inside) String() string { return proto.CompactTextString(m) }
示例9: String
func (m *MessageWithMap) String() string { return proto.CompactTextString(m) }
示例10: String
func (m *IndexQueries) String() string { return proto.CompactTextString(m) }
示例11: TestCompactText
func TestCompactText(t *testing.T) {
s := proto.CompactTextString(newTestMessage())
if s != compactText {
t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v\n===\n", s, compactText)
}
}
示例12: String
func (m *FooWithRepeated) String() string { return proto.CompactTextString(m) }
示例13: String
func (m *NinOptEnum) String() string { return proto.CompactTextString(m) }
示例14: String
func (m *MoreDefaultsA) String() string { return proto.CompactTextString(m) }
示例15: String
func (m *Aproto3) String() string { return proto.CompactTextString(m) }