goprotobuf: update package doc to mention enum String methods.
R=r
CC=golang-dev
http://codereview.appspot.com/4816069
diff --git a/proto/lib.go b/proto/lib.go
index 6afad34..f794f53 100644
--- a/proto/lib.go
+++ b/proto/lib.go
@@ -53,7 +53,7 @@
have them. They have the form Default_StructName_FieldName.
- Enums are given type names and maps between names to values,
plus a helper function to create values. Enum values are prefixed
- with the enum's type name.
+ with the enum's type name. Enum types have a String method.
- Nested groups and enums have type names prefixed with the name of
the surrounding message type.
- Extensions are given descriptor names that start with E_,
@@ -99,6 +99,9 @@
e := FOO(x)
return &e
}
+ func (x FOO) String() string {
+ return proto.EnumName(FOO_name, int32(x))
+ }
type Test struct {
Label *string `protobuf:"bytes,1,req,name=label"`