Get the enum value out from protobuf messages
With proto3, from enum value to string, you can directly use:
name.String()
The Go protobuf generator emits a map of enum names to values (and vice versa). You can use this map to translate your string to enum value:
str := "Cathy"
value, ok := People_PeopleName_value[str]
if !ok {
panic("invalid enum value")
}
var people People
people.Name = People_PeopleName(value).Enum()