mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-02-06 18:40:55 +00:00
a7cbd06b9b
Consider the case: a.proto publicly imports b.proto b.proto publicly imports c.proto Should a.pb.go include symbols defined in c.pb.go? Historically, it has not. As of #155677, it does. Regardless of which behavior is preferable, #155677 produces broken code in some common situations: If a.proto also publicly imports c.proto, we now generate two copies of the forwarding decls for that file. Restore the pre-#155677 behavior to avoid this breakage. Change-Id: I283600b3be19eac2c3b3c14233bb69fa64661581 Reviewed-on: https://go-review.googlesource.com/c/156348 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
224 lines
7.5 KiB
Go
224 lines
7.5 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: import_public/a.proto
|
|
|
|
package import_public
|
|
|
|
import (
|
|
proto "github.com/golang/protobuf/proto"
|
|
sub "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub"
|
|
sub2 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub2"
|
|
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
|
|
prototype "github.com/golang/protobuf/v2/reflect/prototype"
|
|
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
// Symbols defined in public import of import_public/sub/a.proto
|
|
|
|
type E = sub.E
|
|
|
|
const E_ZERO = sub.E_ZERO
|
|
|
|
var E_name = sub.E_name
|
|
var E_value = sub.E_value
|
|
|
|
type M_Subenum = sub.M_Subenum
|
|
|
|
const M_M_ZERO = sub.M_M_ZERO
|
|
|
|
var M_Subenum_name = sub.M_Subenum_name
|
|
var M_Subenum_value = sub.M_Subenum_value
|
|
|
|
type M_Submessage_Submessage_Subenum = sub.M_Submessage_Submessage_Subenum
|
|
|
|
const M_Submessage_M_SUBMESSAGE_ZERO = sub.M_Submessage_M_SUBMESSAGE_ZERO
|
|
|
|
var M_Submessage_Submessage_Subenum_name = sub.M_Submessage_Submessage_Subenum_name
|
|
var M_Submessage_Submessage_Subenum_value = sub.M_Submessage_Submessage_Subenum_value
|
|
|
|
type M = sub.M
|
|
|
|
const Default_M_S = sub.Default_M_S
|
|
|
|
var Default_M_B = sub.Default_M_B
|
|
var Default_M_F = sub.Default_M_F
|
|
|
|
type M_OneofInt32 = sub.M_OneofInt32
|
|
type M_OneofInt64 = sub.M_OneofInt64
|
|
type M_Submessage = sub.M_Submessage
|
|
type M_Submessage_SubmessageOneofInt32 = sub.M_Submessage_SubmessageOneofInt32
|
|
type M_Submessage_SubmessageOneofInt64 = sub.M_Submessage_SubmessageOneofInt64
|
|
|
|
var E_ExtensionField = sub.E_ExtensionField
|
|
|
|
// Symbols defined in public import of import_public/sub2/a.proto
|
|
|
|
type Sub2Message = sub2.Sub2Message
|
|
|
|
type Public struct {
|
|
M *sub.M `protobuf:"bytes,1,opt,name=m" json:"m,omitempty"`
|
|
E *sub.E `protobuf:"varint,2,opt,name=e,enum=goproto.protoc.import_public.sub.E" json:"e,omitempty"`
|
|
Local *Local `protobuf:"bytes,3,opt,name=local" json:"local,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
type xxx_Public struct{ m *Public }
|
|
|
|
func (m *Public) ProtoReflect() protoreflect.Message {
|
|
return xxx_Public{m}
|
|
}
|
|
func (m xxx_Public) Type() protoreflect.MessageType {
|
|
return xxx_A_ProtoFile_MessageTypes[0].Type
|
|
}
|
|
func (m xxx_Public) KnownFields() protoreflect.KnownFields {
|
|
return xxx_A_ProtoFile_MessageTypes[0].KnownFieldsOf(m.m)
|
|
}
|
|
func (m xxx_Public) UnknownFields() protoreflect.UnknownFields {
|
|
return xxx_A_ProtoFile_MessageTypes[0].UnknownFieldsOf(m.m)
|
|
}
|
|
func (m xxx_Public) Interface() protoreflect.ProtoMessage {
|
|
return m.m
|
|
}
|
|
|
|
func (m *Public) Reset() { *m = Public{} }
|
|
func (m *Public) String() string { return proto.CompactTextString(m) }
|
|
func (*Public) ProtoMessage() {}
|
|
func (*Public) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_73b7577c95fa6b70, []int{0}
|
|
}
|
|
|
|
func (m *Public) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Public.Unmarshal(m, b)
|
|
}
|
|
func (m *Public) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Public.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Public) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Public.Merge(m, src)
|
|
}
|
|
func (m *Public) XXX_Size() int {
|
|
return xxx_messageInfo_Public.Size(m)
|
|
}
|
|
func (m *Public) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Public.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Public proto.InternalMessageInfo
|
|
|
|
func (m *Public) GetM() *sub.M {
|
|
if m != nil {
|
|
return m.M
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Public) GetE() sub.E {
|
|
if m != nil && m.E != nil {
|
|
return *m.E
|
|
}
|
|
return sub.E_ZERO
|
|
}
|
|
|
|
func (m *Public) GetLocal() *Local {
|
|
if m != nil {
|
|
return m.Local
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("import_public/a.proto", fileDescriptor_73b7577c95fa6b70)
|
|
proto.RegisterType((*Public)(nil), "goproto.protoc.import_public.Public")
|
|
}
|
|
|
|
var fileDescriptor_73b7577c95fa6b70 = []byte{
|
|
// 210 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0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0x18, 0x1b, 0xc0,
|
|
0x10, 0xc0, 0x18, 0xc0, 0x04, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x41, 0x0a, 0x11, 0x7f, 0x01,
|
|
0x00, 0x00,
|
|
}
|
|
|
|
func init() {
|
|
xxx_A_ProtoFile_FileDesc.Messages = xxx_A_ProtoFile_MessageDescs[0:1]
|
|
xxx_A_ProtoFile_MessageDescs[0].Fields[0].MessageType = protoimpl.X.MessageTypeOf((*sub.M)(nil))
|
|
xxx_A_ProtoFile_MessageDescs[0].Fields[1].EnumType = protoimpl.X.EnumTypeOf(sub.E(0))
|
|
xxx_A_ProtoFile_MessageDescs[0].Fields[2].MessageType = protoimpl.X.MessageTypeOf((*Local)(nil))
|
|
var err error
|
|
A_ProtoFile, err = prototype.NewFile(&xxx_A_ProtoFile_FileDesc)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
|
|
|
|
var A_ProtoFile protoreflect.FileDescriptor
|
|
|
|
var xxx_A_ProtoFile_FileDesc = prototype.File{
|
|
Syntax: protoreflect.Proto2,
|
|
Path: "import_public/a.proto",
|
|
Package: "goproto.protoc.import_public",
|
|
Imports: []protoreflect.FileImport{
|
|
{FileDescriptor: prototype.PlaceholderFile("import_public/sub/a.proto", "goproto.protoc.import_public.sub"), IsPublic: true},
|
|
{FileDescriptor: prototype.PlaceholderFile("import_public/sub2/a.proto", "goproto.protoc.import_public.sub2"), IsPublic: true},
|
|
{FileDescriptor: prototype.PlaceholderFile("import_public/b.proto", "goproto.protoc.import_public"), IsPublic: true},
|
|
},
|
|
}
|
|
var xxx_A_ProtoFile_MessageTypes = [1]protoimpl.MessageType{
|
|
{Type: prototype.GoMessage(
|
|
xxx_A_ProtoFile_MessageDescs[0].Reference(),
|
|
func(protoreflect.MessageType) protoreflect.ProtoMessage {
|
|
return new(Public)
|
|
},
|
|
)},
|
|
}
|
|
var xxx_A_ProtoFile_MessageDescs = [1]prototype.Message{
|
|
{
|
|
Name: "Public",
|
|
Fields: []prototype.Field{
|
|
{
|
|
Name: "m",
|
|
Number: 1,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.MessageKind,
|
|
JSONName: "m",
|
|
IsPacked: prototype.False,
|
|
},
|
|
{
|
|
Name: "e",
|
|
Number: 2,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.EnumKind,
|
|
JSONName: "e",
|
|
IsPacked: prototype.False,
|
|
},
|
|
{
|
|
Name: "local",
|
|
Number: 3,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.MessageKind,
|
|
JSONName: "local",
|
|
IsPacked: prototype.False,
|
|
},
|
|
},
|
|
},
|
|
}
|