code: func FindEnumForFile(f *pb.FileDescriptorProto, name string) int {
  	for i, x := range f.GetEnumType() {
  		if x.GetName() == name {
  			return i
  		}
  	}
  	return -1
  }
docs: // FindEnumForFile searches for an EnumDescriptorProto by name.