encoding/textpb: fix handling of group field name
Group field name in textproto should be the type name. Its field name
is derived from lowercasing its type name.
Change-Id: Ia12aafe934d3a59f3e07d09fe7939cfa6595a7b8
Reviewed-on: https://go-review.googlesource.com/c/157821
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/encoding/textpb/encode_test.go b/encoding/textpb/encode_test.go
index 83cbbc5..9871e75 100644
--- a/encoding/textpb/encode_test.go
+++ b/encoding/textpb/encode_test.go
@@ -316,7 +316,7 @@
Optgroup: &pb2.Nests_OptGroup{},
},
want: `opt_nested: {}
-optgroup: {}
+OptGroup: {}
`,
}, {
desc: "proto2 nested messages",
@@ -349,13 +349,13 @@
},
},
},
- want: `optgroup: {
+ want: `OptGroup: {
opt_bool: true
opt_string: "inside a group"
opt_nested: {
opt_string: "nested message inside a group"
}
- optnestedgroup: {
+ OptNestedGroup: {
opt_enum: TENTH
}
}