Behave gracefully when text formatting a map field with a nil value.
Fixes #33.
diff --git a/proto/text_test.go b/proto/text_test.go
index 03e9a98..39861d1 100644
--- a/proto/text_test.go
+++ b/proto/text_test.go
@@ -426,6 +426,11 @@
&pb.MessageWithMap{NameMapping: map[int32]string{1234: "Feist"}},
`name_mapping:<key:1234 value:"Feist" >`,
},
+ // map with nil value; not well-defined, but we shouldn't crash
+ {
+ &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{7: nil}},
+ `msg_mapping:<key:7 >`,
+ },
}
for _, test := range tests {
got := strings.TrimSpace(test.m.String())