// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by protoc-gen-go. DO NOT EDIT. // source: cmd/protoc-gen-go/testdata/fieldnames/fieldnames.proto package fieldnames import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ) // Assorted edge cases in field name conflict resolution. // // Not all (or possibly any) of these behave in an easily-understood fashion. // This exists to demonstrate the current behavior and catch unintended // changes in it. type Message struct { state protoimpl.MessageState `protogen:"open.v1"` // Various CamelCase conversions. FieldOne *string `protobuf:"bytes,1,opt,name=field_one,json=fieldOne" json:"field_one,omitempty"` FieldTwo *string `protobuf:"bytes,2,opt,name=FieldTwo" json:"FieldTwo,omitempty"` FieldThree *string `protobuf:"bytes,3,opt,name=fieldThree" json:"fieldThree,omitempty"` Field_Four *string `protobuf:"bytes,4,opt,name=field__four,json=fieldFour" json:"field__four,omitempty"` // Field names that conflict with standard methods on the message struct. Descriptor_ *string `protobuf:"bytes,10,opt,name=descriptor" json:"descriptor,omitempty"` Marshal_ *string `protobuf:"bytes,11,opt,name=marshal" json:"marshal,omitempty"` Unmarshal_ *string `protobuf:"bytes,12,opt,name=unmarshal" json:"unmarshal,omitempty"` ProtoMessage_ *string `protobuf:"bytes,13,opt,name=proto_message,json=protoMessage" json:"proto_message,omitempty"` // Field names that conflict with each other after CamelCasing. CamelCase *string `protobuf:"bytes,20,opt,name=CamelCase" json:"CamelCase,omitempty"` CamelCase_ *string `protobuf:"bytes,21,opt,name=CamelCase_,json=CamelCase" json:"CamelCase_,omitempty"` CamelCase__ *string `protobuf:"bytes,22,opt,name=camel_case,json=camelCase" json:"camel_case,omitempty"` // conflicts with 20, 21 CamelCase___ *string `protobuf:"bytes,23,opt,name=CamelCase__,json=CamelCase" json:"CamelCase__,omitempty"` // conflicts with 21, 21, renamed 22 // Field with a getter that conflicts with another field. GetName *string `protobuf:"bytes,30,opt,name=get_name,json=getName" json:"get_name,omitempty"` Name_ *string `protobuf:"bytes,31,opt,name=name" json:"name,omitempty"` // Oneof that conflicts with its first field: The oneof is renamed. // // Types that are valid to be assigned to OneofConflictA_: // // *Message_OneofConflictA OneofConflictA_ isMessage_OneofConflictA_ `protobuf_oneof:"oneof_conflict_a"` // Oneof that conflicts with its second field: The field is renamed. // // Types that are valid to be assigned to OneofConflictB: // // *Message_OneofNoConflict // *Message_OneofConflictB_ OneofConflictB isMessage_OneofConflictB `protobuf_oneof:"oneof_conflict_b"` // Oneof with a field name that conflicts with a nested message. // // Types that are valid to be assigned to OneofConflictC: // // *Message_OneofMessageConflict_ OneofConflictC isMessage_OneofConflictC `protobuf_oneof:"oneof_conflict_c"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Message) Reset() { *x = Message{} mi := &file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Message) String() string { return protoimpl.X.MessageStringOf(x) } func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { mi := &file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { return file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescGZIP(), []int{0} } func (x *Message) GetFieldOne() string { if x != nil && x.FieldOne != nil { return *x.FieldOne } return "" } func (x *Message) GetFieldTwo() string { if x != nil && x.FieldTwo != nil { return *x.FieldTwo } return "" } func (x *Message) GetFieldThree() string { if x != nil && x.FieldThree != nil { return *x.FieldThree } return "" } func (x *Message) GetField_Four() string { if x != nil && x.Field_Four != nil { return *x.Field_Four } return "" } func (x *Message) GetDescriptor_() string { if x != nil && x.Descriptor_ != nil { return *x.Descriptor_ } return "" } func (x *Message) GetMarshal_() string { if x != nil && x.Marshal_ != nil { return *x.Marshal_ } return "" } func (x *Message) GetUnmarshal_() string { if x != nil && x.Unmarshal_ != nil { return *x.Unmarshal_ } return "" } func (x *Message) GetProtoMessage_() string { if x != nil && x.ProtoMessage_ != nil { return *x.ProtoMessage_ } return "" } func (x *Message) GetCamelCase() string { if x != nil && x.CamelCase != nil { return *x.CamelCase } return "" } func (x *Message) GetCamelCase_() string { if x != nil && x.CamelCase_ != nil { return *x.CamelCase_ } return "" } func (x *Message) GetCamelCase__() string { if x != nil && x.CamelCase__ != nil { return *x.CamelCase__ } return "" } func (x *Message) GetCamelCase___() string { if x != nil && x.CamelCase___ != nil { return *x.CamelCase___ } return "" } func (x *Message) GetGetName() string { if x != nil && x.GetName != nil { return *x.GetName } return "" } func (x *Message) GetName_() string { if x != nil && x.Name_ != nil { return *x.Name_ } return "" } func (x *Message) GetOneofConflictA_() isMessage_OneofConflictA_ { if x != nil { return x.OneofConflictA_ } return nil } func (x *Message) GetOneofConflictA() string { if x != nil { if x, ok := x.OneofConflictA_.(*Message_OneofConflictA); ok { return x.OneofConflictA } } return "" } func (x *Message) GetOneofConflictB() isMessage_OneofConflictB { if x != nil { return x.OneofConflictB } return nil } func (x *Message) GetOneofNoConflict() string { if x != nil { if x, ok := x.OneofConflictB.(*Message_OneofNoConflict); ok { return x.OneofNoConflict } } return "" } func (x *Message) GetOneofConflictB_() string { if x != nil { if x, ok := x.OneofConflictB.(*Message_OneofConflictB_); ok { return x.OneofConflictB_ } } return "" } func (x *Message) GetOneofConflictC() isMessage_OneofConflictC { if x != nil { return x.OneofConflictC } return nil } func (x *Message) GetOneofMessageConflict() string { if x != nil { if x, ok := x.OneofConflictC.(*Message_OneofMessageConflict_); ok { return x.OneofMessageConflict } } return "" } type isMessage_OneofConflictA_ interface { isMessage_OneofConflictA_() } type Message_OneofConflictA struct { OneofConflictA string `protobuf:"bytes,40,opt,name=OneofConflictA,oneof"` } func (*Message_OneofConflictA) isMessage_OneofConflictA_() {} type isMessage_OneofConflictB interface { isMessage_OneofConflictB() } type Message_OneofNoConflict struct { OneofNoConflict string `protobuf:"bytes,50,opt,name=oneof_no_conflict,json=oneofNoConflict,oneof"` } type Message_OneofConflictB_ struct { OneofConflictB_ string `protobuf:"bytes,51,opt,name=OneofConflictB,oneof"` } func (*Message_OneofNoConflict) isMessage_OneofConflictB() {} func (*Message_OneofConflictB_) isMessage_OneofConflictB() {} type isMessage_OneofConflictC interface { isMessage_OneofConflictC() } type Message_OneofMessageConflict_ struct { OneofMessageConflict string `protobuf:"bytes,60,opt,name=oneof_message_conflict,json=oneofMessageConflict,oneof"` } func (*Message_OneofMessageConflict_) isMessage_OneofConflictC() {} type Message_OneofMessageConflict struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Message_OneofMessageConflict) Reset() { *x = Message_OneofMessageConflict{} mi := &file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Message_OneofMessageConflict) String() string { return protoimpl.X.MessageStringOf(x) } func (*Message_OneofMessageConflict) ProtoMessage() {} func (x *Message_OneofMessageConflict) ProtoReflect() protoreflect.Message { mi := &file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Message_OneofMessageConflict.ProtoReflect.Descriptor instead. func (*Message_OneofMessageConflict) Descriptor() ([]byte, []int) { return file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescGZIP(), []int{0, 0} } var File_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto protoreflect.FileDescriptor const file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDesc = "" + "\n" + "6cmd/protoc-gen-go/testdata/fieldnames/fieldnames.proto\x12\x19goproto.protoc.fieldnames\"\xb8\x05\n" + "\aMessage\x12\x1b\n" + "\tfield_one\x18\x01 \x01(\tR\bfieldOne\x12\x1a\n" + "\bFieldTwo\x18\x02 \x01(\tR\bFieldTwo\x12\x1e\n" + "\n" + "fieldThree\x18\x03 \x01(\tR\n" + "fieldThree\x12\x1e\n" + "\vfield__four\x18\x04 \x01(\tR\tfieldFour\x12\x1e\n" + "\n" + "descriptor\x18\n" + " \x01(\tR\n" + "descriptor\x12\x18\n" + "\amarshal\x18\v \x01(\tR\amarshal\x12\x1c\n" + "\tunmarshal\x18\f \x01(\tR\tunmarshal\x12#\n" + "\rproto_message\x18\r \x01(\tR\fprotoMessage\x12\x1c\n" + "\tCamelCase\x18\x14 \x01(\tR\tCamelCase\x12\x1d\n" + "\n" + "CamelCase_\x18\x15 \x01(\tR\tCamelCase\x12\x1d\n" + "\n" + "camel_case\x18\x16 \x01(\tR\tcamelCase\x12\x1e\n" + "\vCamelCase__\x18\x17 \x01(\tR\tCamelCase\x12\x19\n" + "\bget_name\x18\x1e \x01(\tR\agetName\x12\x12\n" + "\x04name\x18\x1f \x01(\tR\x04name\x12(\n" + "\x0eOneofConflictA\x18( \x01(\tH\x00R\x0eOneofConflictA\x12,\n" + "\x11oneof_no_conflict\x182 \x01(\tH\x01R\x0foneofNoConflict\x12(\n" + "\x0eOneofConflictB\x183 \x01(\tH\x01R\x0eOneofConflictB\x126\n" + "\x16oneof_message_conflict\x18< \x01(\tH\x02R\x14oneofMessageConflict\x1a\x16\n" + "\x14OneofMessageConflictB\x12\n" + "\x10oneof_conflict_aB\x12\n" + "\x10oneof_conflict_bB\x12\n" + "\x10oneof_conflict_cBBZ@google.golang.org/protobuf/cmd/protoc-gen-go/testdata/fieldnames" var ( file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescOnce sync.Once file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescData []byte ) func file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescGZIP() []byte { file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescOnce.Do(func() { file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDesc), len(file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDesc))) }) return file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDescData } var file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_goTypes = []any{ (*Message)(nil), // 0: goproto.protoc.fieldnames.Message (*Message_OneofMessageConflict)(nil), // 1: goproto.protoc.fieldnames.Message.OneofMessageConflict } var file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_init() } func file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_init() { if File_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto != nil { return } file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[0].OneofWrappers = []any{ (*Message_OneofConflictA)(nil), (*Message_OneofNoConflict)(nil), (*Message_OneofConflictB_)(nil), (*Message_OneofMessageConflict_)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDesc), len(file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_goTypes, DependencyIndexes: file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_depIdxs, MessageInfos: file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes, }.Build() File_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto = out.File file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_goTypes = nil file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_depIdxs = nil }