cmd/protoc-gen-go: fix init order for v1 registration
The v1 registration leaks the message types out to the proto package.
When doing that, it must ensure that the reflection data structures
for those types are properly initialized first. We achieve that by
doing v1 registration at the end of the reflection init function.
Change-Id: If6df18df59d05bad50ff39c2eff6beb19e7466cc
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168348
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go
index 70ecbc9..fc9cb45 100644
--- a/cmd/protoc-gen-go/internal_gengo/main.go
+++ b/cmd/protoc-gen-go/internal_gengo/main.go
@@ -132,7 +132,6 @@
}
genExtensions(gen, g, f)
- genInitFunction(gen, g, f)
genFileDescriptor(gen, g, f)
genReflectFileDescriptor(gen, g, f)
@@ -775,15 +774,14 @@
return f.GoImportPath.Ident(name)
}
-// genInitFunction generates an init function that registers the types in the
-// generated file with the proto package.
-func genInitFunction(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) {
+// genRegistrationV1 generates the init function body that registers the
+// types in the generated file with the v1 proto package.
+func genRegistrationV1(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) {
// TODO: Remove this function when we always register with v2.
if isDescriptor(f.File) {
return
}
- g.P("func init() {")
g.P(protoPackage.Ident("RegisterFile"), "(", strconv.Quote(f.Desc.Path()), ", ", f.descriptorGzipVar, ")")
for _, enum := range f.allEnums {
name := enum.GoIdent.GoName
@@ -818,8 +816,6 @@
for _, extension := range f.allExtensions {
g.P(protoPackage.Ident("RegisterExtension"), "(", extensionVar(f.File, extension), ")")
}
- g.P("}")
- g.P()
}
// deprecationComment returns a standard deprecation comment if deprecated is true.
diff --git a/cmd/protoc-gen-go/internal_gengo/reflect.go b/cmd/protoc-gen-go/internal_gengo/reflect.go
index 7f2d25f..c2f429e 100644
--- a/cmd/protoc-gen-go/internal_gengo/reflect.go
+++ b/cmd/protoc-gen-go/internal_gengo/reflect.go
@@ -207,6 +207,8 @@
}
}
+ genRegistrationV1(gen, g, f)
+
g.P(goTypesVarName(f), " = nil") // allow GC to reclaim resource
g.P(depIdxsVarName(f), " = nil") // allow GC to reclaim resource
g.P("}")
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
index 139bdaa..e2d071c 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
+++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
@@ -100,12 +100,6 @@
return ""
}
-func init() {
- proto.RegisterFile("annotations/annotations.proto", xxx_File_annotations_annotations_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.annotations.AnnotationsTestEnum", AnnotationsTestEnum_name, AnnotationsTestEnum_value)
- proto.RegisterType((*AnnotationsTestMessage)(nil), "goproto.protoc.annotations.AnnotationsTestMessage")
-}
-
var xxx_File_annotations_annotations_proto_rawdesc = []byte{
// 265 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1d, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e,
@@ -159,6 +153,9 @@
xxx_File_annotations_annotations_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_annotations_annotations_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("annotations/annotations.proto", xxx_File_annotations_annotations_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.annotations.AnnotationsTestEnum", AnnotationsTestEnum_name, AnnotationsTestEnum_value)
+ proto.RegisterType((*AnnotationsTestMessage)(nil), "goproto.protoc.annotations.AnnotationsTestMessage")
xxx_File_annotations_annotations_proto_goTypes = nil
xxx_File_annotations_annotations_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/comments/comments.pb.go b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
index 6f1d23e..d159b09 100644
--- a/cmd/protoc-gen-go/testdata/comments/comments.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
@@ -280,16 +280,6 @@
var xxx_messageInfo_Message2_Message2B proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("comments/comments.proto", xxx_File_comments_comments_proto_rawdesc_gzipped)
- proto.RegisterType((*Message1)(nil), "goproto.protoc.comments.Message1")
- proto.RegisterType((*Message2)(nil), "goproto.protoc.comments.Message2")
- proto.RegisterType((*Message1_Message1A)(nil), "goproto.protoc.comments.Message1.Message1A")
- proto.RegisterType((*Message1_Message1B)(nil), "goproto.protoc.comments.Message1.Message1B")
- proto.RegisterType((*Message2_Message2A)(nil), "goproto.protoc.comments.Message2.Message2A")
- proto.RegisterType((*Message2_Message2B)(nil), "goproto.protoc.comments.Message2.Message2B")
-}
-
var xxx_File_comments_comments_proto_rawdesc = []byte{
// 272 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65,
@@ -345,6 +335,13 @@
xxx_File_comments_comments_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_comments_comments_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("comments/comments.proto", xxx_File_comments_comments_proto_rawdesc_gzipped)
+ proto.RegisterType((*Message1)(nil), "goproto.protoc.comments.Message1")
+ proto.RegisterType((*Message2)(nil), "goproto.protoc.comments.Message2")
+ proto.RegisterType((*Message1_Message1A)(nil), "goproto.protoc.comments.Message1.Message1A")
+ proto.RegisterType((*Message1_Message1B)(nil), "goproto.protoc.comments.Message1.Message1B")
+ proto.RegisterType((*Message2_Message2A)(nil), "goproto.protoc.comments.Message2.Message2A")
+ proto.RegisterType((*Message2_Message2B)(nil), "goproto.protoc.comments.Message2.Message2B")
xxx_File_comments_comments_proto_goTypes = nil
xxx_File_comments_comments_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
index 442e208..ffee4cb 100644
--- a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
@@ -87,12 +87,6 @@
return ""
}
-func init() {
- proto.RegisterFile("comments/deprecated.proto", xxx_File_comments_deprecated_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.comments.DeprecatedEnum", DeprecatedEnum_name, DeprecatedEnum_value)
- proto.RegisterType((*DeprecatedMessage)(nil), "goproto.protoc.comments.DeprecatedMessage")
-}
-
var xxx_File_comments_deprecated_proto_rawdesc = []byte{
// 246 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x72, 0x65,
@@ -145,6 +139,9 @@
xxx_File_comments_deprecated_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_comments_deprecated_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("comments/deprecated.proto", xxx_File_comments_deprecated_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.comments.DeprecatedEnum", DeprecatedEnum_name, DeprecatedEnum_value)
+ proto.RegisterType((*DeprecatedMessage)(nil), "goproto.protoc.comments.DeprecatedMessage")
xxx_File_comments_deprecated_proto_goTypes = nil
xxx_File_comments_deprecated_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
index b18d32d..3d15a81 100644
--- a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
@@ -111,12 +111,6 @@
var xxx_messageInfo_MessageSetWireFormatMessage proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("extensions/base/base.proto", xxx_File_extensions_base_base_proto_rawdesc_gzipped)
- proto.RegisterType((*BaseMessage)(nil), "goproto.protoc.extension.base.BaseMessage")
- proto.RegisterType((*MessageSetWireFormatMessage)(nil), "goproto.protoc.extension.base.MessageSetWireFormatMessage")
-}
-
var xxx_File_extensions_base_base_proto_rawdesc = []byte{
// 233 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x61, 0x73,
@@ -166,6 +160,9 @@
xxx_File_extensions_base_base_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_extensions_base_base_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("extensions/base/base.proto", xxx_File_extensions_base_base_proto_rawdesc_gzipped)
+ proto.RegisterType((*BaseMessage)(nil), "goproto.protoc.extension.base.BaseMessage")
+ proto.RegisterType((*MessageSetWireFormatMessage)(nil), "goproto.protoc.extension.base.MessageSetWireFormatMessage")
xxx_File_extensions_base_base_proto_goTypes = nil
xxx_File_extensions_base_base_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
index 2d08e1c..80459cb 100644
--- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
@@ -874,64 +874,6 @@
// extend goproto.protoc.extension.base.MessageSetWireFormatMessage { optional goproto.protoc.extension.ext.MessageSetWireFormatExtension message_set_extension = 100; }
E_MessageSetWireFormatExtension_MessageSetExtension = &xxx_File_extensions_ext_ext_proto_extDescs[43]
)
-
-func init() {
- proto.RegisterFile("extensions/ext/ext.proto", xxx_File_extensions_ext_ext_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.extension.ext.Enum", Enum_name, Enum_value)
- proto.RegisterType((*Message)(nil), "goproto.protoc.extension.ext.Message")
- proto.RegisterType((*ExtensionGroup)(nil), "goproto.protoc.extension.ext.ExtensionGroup")
- proto.RegisterType((*ExtendingMessage)(nil), "goproto.protoc.extension.ext.ExtendingMessage")
- proto.RegisterType((*RepeatedGroup)(nil), "goproto.protoc.extension.ext.RepeatedGroup")
- proto.RegisterType((*Extendable)(nil), "goproto.protoc.extension.ext.Extendable")
- proto.RegisterType((*MessageSetWireFormatExtension)(nil), "goproto.protoc.extension.ext.MessageSetWireFormatExtension")
- proto.RegisterType((*Message_M)(nil), "goproto.protoc.extension.ext.Message.M")
- proto.RegisterType((*ExtendingMessage_ExtendingMessageSubmessage)(nil), "goproto.protoc.extension.ext.ExtendingMessage.ExtendingMessageSubmessage")
- proto.RegisterExtension(E_ExtensionBool)
- proto.RegisterExtension(E_ExtensionEnum)
- proto.RegisterExtension(E_ExtensionInt32)
- proto.RegisterExtension(E_ExtensionSint32)
- proto.RegisterExtension(E_ExtensionUint32)
- proto.RegisterExtension(E_ExtensionInt64)
- proto.RegisterExtension(E_ExtensionSint64)
- proto.RegisterExtension(E_ExtensionUint64)
- proto.RegisterExtension(E_ExtensionSfixed32)
- proto.RegisterExtension(E_ExtensionFixed32)
- proto.RegisterExtension(E_ExtensionFloat)
- proto.RegisterExtension(E_ExtensionSfixed64)
- proto.RegisterExtension(E_ExtensionFixed64)
- proto.RegisterExtension(E_ExtensionDouble)
- proto.RegisterExtension(E_ExtensionString)
- proto.RegisterExtension(E_ExtensionBytes)
- proto.RegisterExtension(E_Extension_Message)
- proto.RegisterExtension(E_Extension_MessageM)
- proto.RegisterExtension(E_Extensiongroup)
- proto.RegisterExtension(E_ExtraMessage)
- proto.RegisterExtension(E_RepeatedXBool)
- proto.RegisterExtension(E_RepeatedXEnum)
- proto.RegisterExtension(E_RepeatedXInt32)
- proto.RegisterExtension(E_RepeatedXSint32)
- proto.RegisterExtension(E_RepeatedXUint32)
- proto.RegisterExtension(E_RepeatedXInt64)
- proto.RegisterExtension(E_RepeatedXSint64)
- proto.RegisterExtension(E_RepeatedXUint64)
- proto.RegisterExtension(E_RepeatedXSfixed32)
- proto.RegisterExtension(E_RepeatedXFixed32)
- proto.RegisterExtension(E_RepeatedXFloat)
- proto.RegisterExtension(E_RepeatedXSfixed64)
- proto.RegisterExtension(E_RepeatedXFixed64)
- proto.RegisterExtension(E_RepeatedXDouble)
- proto.RegisterExtension(E_RepeatedXString)
- proto.RegisterExtension(E_RepeatedXBytes)
- proto.RegisterExtension(E_RepeatedX_Message)
- proto.RegisterExtension(E_Repeatedgroup)
- proto.RegisterExtension(E_ExtendableField)
- proto.RegisterExtension(E_ExtendableStringField)
- proto.RegisterExtension(E_MessageSetExtension)
- proto.RegisterExtension(E_ExtendingMessage_ExtendingMessageString)
- proto.RegisterExtension(E_ExtendingMessage_ExtendingMessageSubmessage)
- proto.RegisterExtension(E_MessageSetWireFormatExtension_MessageSetExtension)
-}
-
var xxx_File_extensions_ext_ext_proto_rawdesc = []byte{
// 4996 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x78, 0x74,
@@ -1351,6 +1293,60 @@
xxx_File_extensions_ext_ext_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_extensions_ext_ext_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("extensions/ext/ext.proto", xxx_File_extensions_ext_ext_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.extension.ext.Enum", Enum_name, Enum_value)
+ proto.RegisterType((*Message)(nil), "goproto.protoc.extension.ext.Message")
+ proto.RegisterType((*ExtensionGroup)(nil), "goproto.protoc.extension.ext.ExtensionGroup")
+ proto.RegisterType((*ExtendingMessage)(nil), "goproto.protoc.extension.ext.ExtendingMessage")
+ proto.RegisterType((*RepeatedGroup)(nil), "goproto.protoc.extension.ext.RepeatedGroup")
+ proto.RegisterType((*Extendable)(nil), "goproto.protoc.extension.ext.Extendable")
+ proto.RegisterType((*MessageSetWireFormatExtension)(nil), "goproto.protoc.extension.ext.MessageSetWireFormatExtension")
+ proto.RegisterType((*Message_M)(nil), "goproto.protoc.extension.ext.Message.M")
+ proto.RegisterType((*ExtendingMessage_ExtendingMessageSubmessage)(nil), "goproto.protoc.extension.ext.ExtendingMessage.ExtendingMessageSubmessage")
+ proto.RegisterExtension(E_ExtensionBool)
+ proto.RegisterExtension(E_ExtensionEnum)
+ proto.RegisterExtension(E_ExtensionInt32)
+ proto.RegisterExtension(E_ExtensionSint32)
+ proto.RegisterExtension(E_ExtensionUint32)
+ proto.RegisterExtension(E_ExtensionInt64)
+ proto.RegisterExtension(E_ExtensionSint64)
+ proto.RegisterExtension(E_ExtensionUint64)
+ proto.RegisterExtension(E_ExtensionSfixed32)
+ proto.RegisterExtension(E_ExtensionFixed32)
+ proto.RegisterExtension(E_ExtensionFloat)
+ proto.RegisterExtension(E_ExtensionSfixed64)
+ proto.RegisterExtension(E_ExtensionFixed64)
+ proto.RegisterExtension(E_ExtensionDouble)
+ proto.RegisterExtension(E_ExtensionString)
+ proto.RegisterExtension(E_ExtensionBytes)
+ proto.RegisterExtension(E_Extension_Message)
+ proto.RegisterExtension(E_Extension_MessageM)
+ proto.RegisterExtension(E_Extensiongroup)
+ proto.RegisterExtension(E_ExtraMessage)
+ proto.RegisterExtension(E_RepeatedXBool)
+ proto.RegisterExtension(E_RepeatedXEnum)
+ proto.RegisterExtension(E_RepeatedXInt32)
+ proto.RegisterExtension(E_RepeatedXSint32)
+ proto.RegisterExtension(E_RepeatedXUint32)
+ proto.RegisterExtension(E_RepeatedXInt64)
+ proto.RegisterExtension(E_RepeatedXSint64)
+ proto.RegisterExtension(E_RepeatedXUint64)
+ proto.RegisterExtension(E_RepeatedXSfixed32)
+ proto.RegisterExtension(E_RepeatedXFixed32)
+ proto.RegisterExtension(E_RepeatedXFloat)
+ proto.RegisterExtension(E_RepeatedXSfixed64)
+ proto.RegisterExtension(E_RepeatedXFixed64)
+ proto.RegisterExtension(E_RepeatedXDouble)
+ proto.RegisterExtension(E_RepeatedXString)
+ proto.RegisterExtension(E_RepeatedXBytes)
+ proto.RegisterExtension(E_RepeatedX_Message)
+ proto.RegisterExtension(E_Repeatedgroup)
+ proto.RegisterExtension(E_ExtendableField)
+ proto.RegisterExtension(E_ExtendableStringField)
+ proto.RegisterExtension(E_MessageSetExtension)
+ proto.RegisterExtension(E_ExtendingMessage_ExtendingMessageString)
+ proto.RegisterExtension(E_ExtendingMessage_ExtendingMessageSubmessage)
+ proto.RegisterExtension(E_MessageSetWireFormatExtension_MessageSetExtension)
xxx_File_extensions_ext_ext_proto_goTypes = nil
xxx_File_extensions_ext_ext_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
index 9019b87..507b395 100644
--- a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
@@ -54,11 +54,6 @@
return nil
}
-func init() {
- proto.RegisterFile("extensions/extra/extra.proto", xxx_File_extensions_extra_extra_proto_rawdesc_gzipped)
- proto.RegisterType((*ExtraMessage)(nil), "goproto.protoc.extension.extra.ExtraMessage")
-}
-
var xxx_File_extensions_extra_extra_proto_rawdesc = []byte{
// 175 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x78, 0x74,
@@ -103,6 +98,8 @@
xxx_File_extensions_extra_extra_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_extensions_extra_extra_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("extensions/extra/extra.proto", xxx_File_extensions_extra_extra_proto_rawdesc_gzipped)
+ proto.RegisterType((*ExtraMessage)(nil), "goproto.protoc.extension.extra.ExtraMessage")
xxx_File_extensions_extra_extra_proto_goTypes = nil
xxx_File_extensions_extra_extra_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
index bc1aac9..5975879 100644
--- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
@@ -456,47 +456,6 @@
// extend google.protobuf.MessageOptions { repeated goproto.protoc.extension.proto3.Message repeated_extension_Message = 2017; }
E_RepeatedExtension_Message = &xxx_File_extensions_proto3_ext3_proto_extDescs[33]
)
-
-func init() {
- proto.RegisterFile("extensions/proto3/ext3.proto", xxx_File_extensions_proto3_ext3_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.extension.proto3.Enum", Enum_name, Enum_value)
- proto.RegisterType((*Message)(nil), "goproto.protoc.extension.proto3.Message")
- proto.RegisterExtension(E_ExtensionBool)
- proto.RegisterExtension(E_ExtensionEnum)
- proto.RegisterExtension(E_ExtensionInt32)
- proto.RegisterExtension(E_ExtensionSint32)
- proto.RegisterExtension(E_ExtensionUint32)
- proto.RegisterExtension(E_ExtensionInt64)
- proto.RegisterExtension(E_ExtensionSint64)
- proto.RegisterExtension(E_ExtensionUint64)
- proto.RegisterExtension(E_ExtensionSfixed32)
- proto.RegisterExtension(E_ExtensionFixed32)
- proto.RegisterExtension(E_ExtensionFloat)
- proto.RegisterExtension(E_ExtensionSfixed64)
- proto.RegisterExtension(E_ExtensionFixed64)
- proto.RegisterExtension(E_ExtensionDouble)
- proto.RegisterExtension(E_ExtensionString)
- proto.RegisterExtension(E_ExtensionBytes)
- proto.RegisterExtension(E_Extension_Message)
- proto.RegisterExtension(E_RepeatedExtensionBool)
- proto.RegisterExtension(E_RepeatedExtensionEnum)
- proto.RegisterExtension(E_RepeatedExtensionInt32)
- proto.RegisterExtension(E_RepeatedExtensionSint32)
- proto.RegisterExtension(E_RepeatedExtensionUint32)
- proto.RegisterExtension(E_RepeatedExtensionInt64)
- proto.RegisterExtension(E_RepeatedExtensionSint64)
- proto.RegisterExtension(E_RepeatedExtensionUint64)
- proto.RegisterExtension(E_RepeatedExtensionSfixed32)
- proto.RegisterExtension(E_RepeatedExtensionFixed32)
- proto.RegisterExtension(E_RepeatedExtensionFloat)
- proto.RegisterExtension(E_RepeatedExtensionSfixed64)
- proto.RegisterExtension(E_RepeatedExtensionFixed64)
- proto.RegisterExtension(E_RepeatedExtensionDouble)
- proto.RegisterExtension(E_RepeatedExtensionString)
- proto.RegisterExtension(E_RepeatedExtensionBytes)
- proto.RegisterExtension(E_RepeatedExtension_Message)
-}
-
var xxx_File_extensions_proto3_ext3_proto_rawdesc = []byte{
// 3278 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x72, 0x6f,
@@ -781,6 +740,43 @@
xxx_File_extensions_proto3_ext3_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_extensions_proto3_ext3_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("extensions/proto3/ext3.proto", xxx_File_extensions_proto3_ext3_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.extension.proto3.Enum", Enum_name, Enum_value)
+ proto.RegisterType((*Message)(nil), "goproto.protoc.extension.proto3.Message")
+ proto.RegisterExtension(E_ExtensionBool)
+ proto.RegisterExtension(E_ExtensionEnum)
+ proto.RegisterExtension(E_ExtensionInt32)
+ proto.RegisterExtension(E_ExtensionSint32)
+ proto.RegisterExtension(E_ExtensionUint32)
+ proto.RegisterExtension(E_ExtensionInt64)
+ proto.RegisterExtension(E_ExtensionSint64)
+ proto.RegisterExtension(E_ExtensionUint64)
+ proto.RegisterExtension(E_ExtensionSfixed32)
+ proto.RegisterExtension(E_ExtensionFixed32)
+ proto.RegisterExtension(E_ExtensionFloat)
+ proto.RegisterExtension(E_ExtensionSfixed64)
+ proto.RegisterExtension(E_ExtensionFixed64)
+ proto.RegisterExtension(E_ExtensionDouble)
+ proto.RegisterExtension(E_ExtensionString)
+ proto.RegisterExtension(E_ExtensionBytes)
+ proto.RegisterExtension(E_Extension_Message)
+ proto.RegisterExtension(E_RepeatedExtensionBool)
+ proto.RegisterExtension(E_RepeatedExtensionEnum)
+ proto.RegisterExtension(E_RepeatedExtensionInt32)
+ proto.RegisterExtension(E_RepeatedExtensionSint32)
+ proto.RegisterExtension(E_RepeatedExtensionUint32)
+ proto.RegisterExtension(E_RepeatedExtensionInt64)
+ proto.RegisterExtension(E_RepeatedExtensionSint64)
+ proto.RegisterExtension(E_RepeatedExtensionUint64)
+ proto.RegisterExtension(E_RepeatedExtensionSfixed32)
+ proto.RegisterExtension(E_RepeatedExtensionFixed32)
+ proto.RegisterExtension(E_RepeatedExtensionFloat)
+ proto.RegisterExtension(E_RepeatedExtensionSfixed64)
+ proto.RegisterExtension(E_RepeatedExtensionFixed64)
+ proto.RegisterExtension(E_RepeatedExtensionDouble)
+ proto.RegisterExtension(E_RepeatedExtensionString)
+ proto.RegisterExtension(E_RepeatedExtensionBytes)
+ proto.RegisterExtension(E_RepeatedExtension_Message)
xxx_File_extensions_proto3_ext3_proto_goTypes = nil
xxx_File_extensions_proto3_ext3_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
index d42049a..02d8712 100644
--- a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
+++ b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
@@ -314,12 +314,6 @@
var xxx_messageInfo_Message_OneofMessageConflict proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("fieldnames/fieldnames.proto", xxx_File_fieldnames_fieldnames_proto_rawdesc_gzipped)
- proto.RegisterType((*Message)(nil), "goproto.protoc.fieldnames.Message")
- proto.RegisterType((*Message_OneofMessageConflict)(nil), "goproto.protoc.fieldnames.Message.OneofMessageConflict")
-}
-
var xxx_File_fieldnames_fieldnames_proto_rawdesc = []byte{
// 826 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2f, 0x66, 0x69, 0x65,
@@ -406,6 +400,9 @@
xxx_File_fieldnames_fieldnames_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_fieldnames_fieldnames_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("fieldnames/fieldnames.proto", xxx_File_fieldnames_fieldnames_proto_rawdesc_gzipped)
+ proto.RegisterType((*Message)(nil), "goproto.protoc.fieldnames.Message")
+ proto.RegisterType((*Message_OneofMessageConflict)(nil), "goproto.protoc.fieldnames.Message.OneofMessageConflict")
xxx_File_fieldnames_fieldnames_proto_goTypes = nil
xxx_File_fieldnames_fieldnames_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/a.pb.go
index 402131b..ceb4196 100644
--- a/cmd/protoc-gen-go/testdata/import_public/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/a.pb.go
@@ -114,11 +114,6 @@
return nil
}
-func init() {
- proto.RegisterFile("import_public/a.proto", xxx_File_import_public_a_proto_rawdesc_gzipped)
- proto.RegisterType((*Public)(nil), "goproto.protoc.import_public.Public")
-}
-
var xxx_File_import_public_a_proto_rawdesc = []byte{
// 383 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f,
@@ -184,6 +179,8 @@
xxx_File_import_public_a_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_import_public_a_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("import_public/a.proto", xxx_File_import_public_a_proto_rawdesc_gzipped)
+ proto.RegisterType((*Public)(nil), "goproto.protoc.import_public.Public")
xxx_File_import_public_a_proto_goTypes = nil
xxx_File_import_public_a_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/b.pb.go b/cmd/protoc-gen-go/testdata/import_public/b.pb.go
index 3cd1d46..56f9a72 100644
--- a/cmd/protoc-gen-go/testdata/import_public/b.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/b.pb.go
@@ -63,11 +63,6 @@
return sub.E_ZERO
}
-func init() {
- proto.RegisterFile("import_public/b.proto", xxx_File_import_public_b_proto_rawdesc_gzipped)
- proto.RegisterType((*Local)(nil), "goproto.protoc.import_public.Local")
-}
-
var xxx_File_import_public_b_proto_rawdesc = []byte{
// 265 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f,
@@ -123,6 +118,8 @@
xxx_File_import_public_b_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_import_public_b_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("import_public/b.proto", xxx_File_import_public_b_proto_rawdesc_gzipped)
+ proto.RegisterType((*Local)(nil), "goproto.protoc.import_public.Local")
xxx_File_import_public_b_proto_goTypes = nil
xxx_File_import_public_b_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
index 0397983..bad05bc 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
@@ -386,17 +386,6 @@
// extend goproto.protoc.import_public.sub.M { optional string extension_field = 100; }
E_ExtensionField = &xxx_File_import_public_sub_a_proto_extDescs[0]
)
-
-func init() {
- proto.RegisterFile("import_public/sub/a.proto", xxx_File_import_public_sub_a_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.import_public.sub.E", E_name, E_value)
- proto.RegisterEnum("goproto.protoc.import_public.sub.M_Subenum", M_Subenum_name, M_Subenum_value)
- proto.RegisterEnum("goproto.protoc.import_public.sub.M_Submessage_Submessage_Subenum", M_Submessage_Submessage_Subenum_name, M_Submessage_Submessage_Subenum_value)
- proto.RegisterType((*M)(nil), "goproto.protoc.import_public.sub.M")
- proto.RegisterType((*M_Submessage)(nil), "goproto.protoc.import_public.sub.M.Submessage")
- proto.RegisterExtension(E_ExtensionField)
-}
-
var xxx_File_import_public_sub_a_proto_rawdesc = []byte{
// 730 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f,
@@ -490,6 +479,13 @@
xxx_File_import_public_sub_a_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_import_public_sub_a_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("import_public/sub/a.proto", xxx_File_import_public_sub_a_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.import_public.sub.E", E_name, E_value)
+ proto.RegisterEnum("goproto.protoc.import_public.sub.M_Subenum", M_Subenum_name, M_Subenum_value)
+ proto.RegisterEnum("goproto.protoc.import_public.sub.M_Submessage_Submessage_Subenum", M_Submessage_Submessage_Subenum_name, M_Submessage_Submessage_Subenum_value)
+ proto.RegisterType((*M)(nil), "goproto.protoc.import_public.sub.M")
+ proto.RegisterType((*M_Submessage)(nil), "goproto.protoc.import_public.sub.M.Submessage")
+ proto.RegisterExtension(E_ExtensionField)
xxx_File_import_public_sub_a_proto_goTypes = nil
xxx_File_import_public_sub_a_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
index 81c15f1..28e3938 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M2 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("import_public/sub/b.proto", xxx_File_import_public_sub_b_proto_rawdesc_gzipped)
- proto.RegisterType((*M2)(nil), "goproto.protoc.import_public.sub.M2")
-}
-
var xxx_File_import_public_sub_b_proto_rawdesc = []byte{
// 145 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f,
@@ -94,6 +89,8 @@
xxx_File_import_public_sub_b_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_import_public_sub_b_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("import_public/sub/b.proto", xxx_File_import_public_sub_b_proto_rawdesc_gzipped)
+ proto.RegisterType((*M2)(nil), "goproto.protoc.import_public.sub.M2")
xxx_File_import_public_sub_b_proto_goTypes = nil
xxx_File_import_public_sub_b_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
index daf8aea..a467e7d 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_Sub2Message proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("import_public/sub2/a.proto", xxx_File_import_public_sub2_a_proto_rawdesc_gzipped)
- proto.RegisterType((*Sub2Message)(nil), "goproto.protoc.import_public.sub2.Sub2Message")
-}
-
var xxx_File_import_public_sub2_a_proto_rawdesc = []byte{
// 157 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f,
@@ -94,6 +89,8 @@
xxx_File_import_public_sub2_a_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_import_public_sub2_a_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("import_public/sub2/a.proto", xxx_File_import_public_sub2_a_proto_rawdesc_gzipped)
+ proto.RegisterType((*Sub2Message)(nil), "goproto.protoc.import_public.sub2.Sub2Message")
xxx_File_import_public_sub2_a_proto_goTypes = nil
xxx_File_import_public_sub2_a_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
index 28834f7..1fe71ef 100644
--- a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("imports/fmt/m.proto", xxx_File_imports_fmt_m_proto_rawdesc_gzipped)
- proto.RegisterType((*M)(nil), "fmt.M")
-}
-
var xxx_File_imports_fmt_m_proto_rawdesc = []byte{
// 111 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x13, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x66, 0x6d, 0x74, 0x2f, 0x6d, 0x2e,
@@ -91,6 +86,8 @@
xxx_File_imports_fmt_m_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_fmt_m_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/fmt/m.proto", xxx_File_imports_fmt_m_proto_rawdesc_gzipped)
+ proto.RegisterType((*M)(nil), "fmt.M")
xxx_File_imports_fmt_m_proto_goTypes = nil
xxx_File_imports_fmt_m_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
index bcbf15f..167c0c9 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
@@ -122,13 +122,6 @@
return nil
}
-func init() {
- proto.RegisterFile("imports/test_a_1/m1.proto", xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped)
- proto.RegisterEnum("test.a.E1", E1_name, E1_value)
- proto.RegisterType((*M1)(nil), "test.a.M1")
- proto.RegisterType((*M1_1)(nil), "test.a.M1_1")
-}
-
var xxx_File_imports_test_a_1_m1_proto_rawdesc = []byte{
// 181 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61,
@@ -180,6 +173,10 @@
xxx_File_imports_test_a_1_m1_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_a_1_m1_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_a_1/m1.proto", xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped)
+ proto.RegisterEnum("test.a.E1", E1_name, E1_value)
+ proto.RegisterType((*M1)(nil), "test.a.M1")
+ proto.RegisterType((*M1_1)(nil), "test.a.M1_1")
xxx_File_imports_test_a_1_m1_proto_goTypes = nil
xxx_File_imports_test_a_1_m1_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
index bd02efc..102318c 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M2 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("imports/test_a_1/m2.proto", xxx_File_imports_test_a_1_m2_proto_rawdesc_gzipped)
- proto.RegisterType((*M2)(nil), "test.a.M2")
-}
-
var xxx_File_imports_test_a_1_m2_proto_rawdesc = []byte{
// 126 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61,
@@ -92,6 +87,8 @@
xxx_File_imports_test_a_1_m2_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_a_1_m2_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_a_1/m2.proto", xxx_File_imports_test_a_1_m2_proto_rawdesc_gzipped)
+ proto.RegisterType((*M2)(nil), "test.a.M2")
xxx_File_imports_test_a_1_m2_proto_goTypes = nil
xxx_File_imports_test_a_1_m2_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
index 81c27b8..f23dce0 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M3 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("imports/test_a_2/m3.proto", xxx_File_imports_test_a_2_m3_proto_rawdesc_gzipped)
- proto.RegisterType((*M3)(nil), "test.a.M3")
-}
-
var xxx_File_imports_test_a_2_m3_proto_rawdesc = []byte{
// 126 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61,
@@ -92,6 +87,8 @@
xxx_File_imports_test_a_2_m3_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_a_2_m3_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_a_2/m3.proto", xxx_File_imports_test_a_2_m3_proto_rawdesc_gzipped)
+ proto.RegisterType((*M3)(nil), "test.a.M3")
xxx_File_imports_test_a_2_m3_proto_goTypes = nil
xxx_File_imports_test_a_2_m3_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
index 339a836..3febc09 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M4 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("imports/test_a_2/m4.proto", xxx_File_imports_test_a_2_m4_proto_rawdesc_gzipped)
- proto.RegisterType((*M4)(nil), "test.a.M4")
-}
-
var xxx_File_imports_test_a_2_m4_proto_rawdesc = []byte{
// 126 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61,
@@ -92,6 +87,8 @@
xxx_File_imports_test_a_2_m4_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_a_2_m4_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_a_2/m4.proto", xxx_File_imports_test_a_2_m4_proto_rawdesc_gzipped)
+ proto.RegisterType((*M4)(nil), "test.a.M4")
xxx_File_imports_test_a_2_m4_proto_goTypes = nil
xxx_File_imports_test_a_2_m4_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
index 021c341..924fc1c 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M1 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("imports/test_b_1/m1.proto", xxx_File_imports_test_b_1_m1_proto_rawdesc_gzipped)
- proto.RegisterType((*M1)(nil), "test.b.part1.M1")
-}
-
var xxx_File_imports_test_b_1_m1_proto_rawdesc = []byte{
// 137 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62,
@@ -93,6 +88,8 @@
xxx_File_imports_test_b_1_m1_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_b_1_m1_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_b_1/m1.proto", xxx_File_imports_test_b_1_m1_proto_rawdesc_gzipped)
+ proto.RegisterType((*M1)(nil), "test.b.part1.M1")
xxx_File_imports_test_b_1_m1_proto_goTypes = nil
xxx_File_imports_test_b_1_m1_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
index 9d65402..02b89ba 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
@@ -46,11 +46,6 @@
var xxx_messageInfo_M2 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("imports/test_b_1/m2.proto", xxx_File_imports_test_b_1_m2_proto_rawdesc_gzipped)
- proto.RegisterType((*M2)(nil), "test.b.part2.M2")
-}
-
var xxx_File_imports_test_b_1_m2_proto_rawdesc = []byte{
// 137 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62,
@@ -93,6 +88,8 @@
xxx_File_imports_test_b_1_m2_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_b_1_m2_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_b_1/m2.proto", xxx_File_imports_test_b_1_m2_proto_rawdesc_gzipped)
+ proto.RegisterType((*M2)(nil), "test.b.part2.M2")
xxx_File_imports_test_b_1_m2_proto_goTypes = nil
xxx_File_imports_test_b_1_m2_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
index e422585..e3117b5 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
@@ -55,11 +55,6 @@
return nil
}
-func init() {
- proto.RegisterFile("imports/test_import_a1m1.proto", xxx_File_imports_test_import_a1m1_proto_rawdesc_gzipped)
- proto.RegisterType((*A1M1)(nil), "test.A1M1")
-}
-
var xxx_File_imports_test_import_a1m1_proto_rawdesc = []byte{
// 175 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69,
@@ -107,6 +102,8 @@
xxx_File_imports_test_import_a1m1_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_import_a1m1_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_import_a1m1.proto", xxx_File_imports_test_import_a1m1_proto_rawdesc_gzipped)
+ proto.RegisterType((*A1M1)(nil), "test.A1M1")
xxx_File_imports_test_import_a1m1_proto_goTypes = nil
xxx_File_imports_test_import_a1m1_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
index ca8539a..99641a3 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
@@ -55,11 +55,6 @@
return nil
}
-func init() {
- proto.RegisterFile("imports/test_import_a1m2.proto", xxx_File_imports_test_import_a1m2_proto_rawdesc_gzipped)
- proto.RegisterType((*A1M2)(nil), "test.A1M2")
-}
-
var xxx_File_imports_test_import_a1m2_proto_rawdesc = []byte{
// 175 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69,
@@ -107,6 +102,8 @@
xxx_File_imports_test_import_a1m2_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_import_a1m2_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_import_a1m2.proto", xxx_File_imports_test_import_a1m2_proto_rawdesc_gzipped)
+ proto.RegisterType((*A1M2)(nil), "test.A1M2")
xxx_File_imports_test_import_a1m2_proto_goTypes = nil
xxx_File_imports_test_import_a1m2_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
index 94e725b..c51a54d 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
@@ -90,11 +90,6 @@
return nil
}
-func init() {
- proto.RegisterFile("imports/test_import_all.proto", xxx_File_imports_test_import_all_proto_rawdesc_gzipped)
- proto.RegisterType((*All)(nil), "test.All")
-}
-
var xxx_File_imports_test_import_all_proto_rawdesc = []byte{
// 462 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1d, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69,
@@ -168,6 +163,8 @@
xxx_File_imports_test_import_all_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_imports_test_import_all_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("imports/test_import_all.proto", xxx_File_imports_test_import_all_proto_rawdesc_gzipped)
+ proto.RegisterType((*All)(nil), "test.All")
xxx_File_imports_test_import_all_proto_goTypes = nil
xxx_File_imports_test_import_all_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
index e700643..f069b11 100644
--- a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
+++ b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
@@ -80,11 +80,6 @@
}
}
-func init() {
- proto.RegisterFile("issue780_oneof_conflict/test.proto", xxx_File_issue780_oneof_conflict_test_proto_rawdesc_gzipped)
- proto.RegisterType((*Foo)(nil), "oneoftest.Foo")
-}
-
var xxx_File_issue780_oneof_conflict_test_proto_rawdesc = []byte{
// 88 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x22, 0x69, 0x73, 0x73, 0x75, 0x65, 0x37, 0x38, 0x30, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66,
@@ -124,6 +119,8 @@
xxx_File_issue780_oneof_conflict_test_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_issue780_oneof_conflict_test_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("issue780_oneof_conflict/test.proto", xxx_File_issue780_oneof_conflict_test_proto_rawdesc_gzipped)
+ proto.RegisterType((*Foo)(nil), "oneoftest.Foo")
xxx_File_issue780_oneof_conflict_test_proto_goTypes = nil
xxx_File_issue780_oneof_conflict_test_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
index e77bef4..cf2f164 100644
--- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
+++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
@@ -110,12 +110,6 @@
return Default_Message_EnumField
}
-func init() {
- proto.RegisterFile("nopackage/nopackage.proto", xxx_File_nopackage_nopackage_proto_rawdesc_gzipped)
- proto.RegisterEnum("Enum", Enum_name, Enum_value)
- proto.RegisterType((*Message)(nil), "Message")
-}
-
var xxx_File_nopackage_nopackage_proto_rawdesc = []byte{
// 135 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x19, 0x6e, 0x6f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2f, 0x6e, 0x6f, 0x70, 0x61,
@@ -163,6 +157,9 @@
xxx_File_nopackage_nopackage_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_nopackage_nopackage_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("nopackage/nopackage.proto", xxx_File_nopackage_nopackage_proto_rawdesc_gzipped)
+ proto.RegisterEnum("Enum", Enum_name, Enum_value)
+ proto.RegisterType((*Message)(nil), "Message")
xxx_File_nopackage_nopackage_proto_goTypes = nil
xxx_File_nopackage_nopackage_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
index 958b1d8..ecfed3c 100644
--- a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
@@ -394,18 +394,6 @@
var xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("proto2/enum.proto", xxx_File_proto2_enum_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.proto2.EnumType1", EnumType1_name, EnumType1_value)
- proto.RegisterEnum("goproto.protoc.proto2.EnumType2", EnumType2_name, EnumType2_value)
- proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_NestedEnumType1A", EnumContainerMessage1_NestedEnumType1A_name, EnumContainerMessage1_NestedEnumType1A_value)
- proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_NestedEnumType1B", EnumContainerMessage1_NestedEnumType1B_name, EnumContainerMessage1_NestedEnumType1B_value)
- proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A", EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name, EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value)
- proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B", EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name, EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value)
- proto.RegisterType((*EnumContainerMessage1)(nil), "goproto.protoc.proto2.EnumContainerMessage1")
- proto.RegisterType((*EnumContainerMessage1_EnumContainerMessage2)(nil), "goproto.protoc.proto2.EnumContainerMessage1.EnumContainerMessage2")
-}
-
var xxx_File_proto2_enum_proto_rawdesc = []byte{
// 624 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72,
@@ -490,6 +478,15 @@
xxx_File_proto2_enum_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_proto2_enum_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("proto2/enum.proto", xxx_File_proto2_enum_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.proto2.EnumType1", EnumType1_name, EnumType1_value)
+ proto.RegisterEnum("goproto.protoc.proto2.EnumType2", EnumType2_name, EnumType2_value)
+ proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_NestedEnumType1A", EnumContainerMessage1_NestedEnumType1A_name, EnumContainerMessage1_NestedEnumType1A_value)
+ proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_NestedEnumType1B", EnumContainerMessage1_NestedEnumType1B_name, EnumContainerMessage1_NestedEnumType1B_value)
+ proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A", EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name, EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value)
+ proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B", EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name, EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value)
+ proto.RegisterType((*EnumContainerMessage1)(nil), "goproto.protoc.proto2.EnumContainerMessage1")
+ proto.RegisterType((*EnumContainerMessage1_EnumContainerMessage2)(nil), "goproto.protoc.proto2.EnumContainerMessage1.EnumContainerMessage2")
xxx_File_proto2_enum_proto_goTypes = nil
xxx_File_proto2_enum_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
index 7d03b09..4806de3 100644
--- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
@@ -1331,20 +1331,6 @@
var xxx_messageInfo_FieldTestMessage_Message proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("proto2/fields.proto", xxx_File_proto2_fields_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.proto2.FieldTestMessage_Enum", FieldTestMessage_Enum_name, FieldTestMessage_Enum_value)
- proto.RegisterType((*FieldTestMessage)(nil), "goproto.protoc.proto2.FieldTestMessage")
- proto.RegisterMapType((map[uint64]FieldTestMessage_Enum)(nil), "goproto.protoc.proto2.FieldTestMessage.MapFixed64EnumEntry")
- proto.RegisterMapType((map[int32]int64)(nil), "goproto.protoc.proto2.FieldTestMessage.MapInt32Int64Entry")
- proto.RegisterMapType((map[string]*FieldTestMessage_Message)(nil), "goproto.protoc.proto2.FieldTestMessage.MapStringMessageEntry")
- proto.RegisterType((*FieldTestMessage_OptionalGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.OptionalGroup")
- proto.RegisterType((*FieldTestMessage_RequiredGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.RequiredGroup")
- proto.RegisterType((*FieldTestMessage_RepeatedGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.RepeatedGroup")
- proto.RegisterType((*FieldTestMessage_OneofGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.OneofGroup")
- proto.RegisterType((*FieldTestMessage_Message)(nil), "goproto.protoc.proto2.FieldTestMessage.Message")
-}
-
var xxx_File_proto2_fields_proto_rawdesc = []byte{
// 5913 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e,
@@ -1778,6 +1764,17 @@
xxx_File_proto2_fields_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_proto2_fields_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("proto2/fields.proto", xxx_File_proto2_fields_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.proto2.FieldTestMessage_Enum", FieldTestMessage_Enum_name, FieldTestMessage_Enum_value)
+ proto.RegisterType((*FieldTestMessage)(nil), "goproto.protoc.proto2.FieldTestMessage")
+ proto.RegisterMapType((map[uint64]FieldTestMessage_Enum)(nil), "goproto.protoc.proto2.FieldTestMessage.MapFixed64EnumEntry")
+ proto.RegisterMapType((map[int32]int64)(nil), "goproto.protoc.proto2.FieldTestMessage.MapInt32Int64Entry")
+ proto.RegisterMapType((map[string]*FieldTestMessage_Message)(nil), "goproto.protoc.proto2.FieldTestMessage.MapStringMessageEntry")
+ proto.RegisterType((*FieldTestMessage_OptionalGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.OptionalGroup")
+ proto.RegisterType((*FieldTestMessage_RequiredGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.RequiredGroup")
+ proto.RegisterType((*FieldTestMessage_RepeatedGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.RepeatedGroup")
+ proto.RegisterType((*FieldTestMessage_OneofGroup)(nil), "goproto.protoc.proto2.FieldTestMessage.OneofGroup")
+ proto.RegisterType((*FieldTestMessage_Message)(nil), "goproto.protoc.proto2.FieldTestMessage.Message")
xxx_File_proto2_fields_proto_goTypes = nil
xxx_File_proto2_fields_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
index 4870f39..47c5214 100644
--- a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
@@ -142,13 +142,6 @@
var xxx_messageInfo_Layer1_Layer2_Layer3 proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("proto2/nested_messages.proto", xxx_File_proto2_nested_messages_proto_rawdesc_gzipped)
- proto.RegisterType((*Layer1)(nil), "goproto.protoc.proto2.Layer1")
- proto.RegisterType((*Layer1_Layer2)(nil), "goproto.protoc.proto2.Layer1.Layer2")
- proto.RegisterType((*Layer1_Layer2_Layer3)(nil), "goproto.protoc.proto2.Layer1.Layer2.Layer3")
-}
-
var xxx_File_proto2_nested_messages_proto_rawdesc = []byte{
// 327 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f,
@@ -209,6 +202,10 @@
xxx_File_proto2_nested_messages_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_proto2_nested_messages_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("proto2/nested_messages.proto", xxx_File_proto2_nested_messages_proto_rawdesc_gzipped)
+ proto.RegisterType((*Layer1)(nil), "goproto.protoc.proto2.Layer1")
+ proto.RegisterType((*Layer1_Layer2)(nil), "goproto.protoc.proto2.Layer1.Layer2")
+ proto.RegisterType((*Layer1_Layer2_Layer3)(nil), "goproto.protoc.proto2.Layer1.Layer2.Layer3")
xxx_File_proto2_nested_messages_proto_goTypes = nil
xxx_File_proto2_nested_messages_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
index 759bfb8..90eb7fa 100644
--- a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
@@ -62,11 +62,6 @@
return nil
}
-func init() {
- proto.RegisterFile("proto2/proto2.proto", xxx_File_proto2_proto2_proto_rawdesc_gzipped)
- proto.RegisterType((*Message)(nil), "goproto.protoc.proto2.Message")
-}
-
var xxx_File_proto2_proto2_proto_rawdesc = []byte{
// 186 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2e,
@@ -114,6 +109,8 @@
xxx_File_proto2_proto2_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_proto2_proto2_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("proto2/proto2.proto", xxx_File_proto2_proto2_proto_rawdesc_gzipped)
+ proto.RegisterType((*Message)(nil), "goproto.protoc.proto2.Message")
xxx_File_proto2_proto2_proto_goTypes = nil
xxx_File_proto2_proto2_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
index 30b1304..68c890b 100644
--- a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
@@ -47,11 +47,6 @@
return xxx_File_proto3_enum_proto_rawdesc_gzipped, []int{0}
}
-func init() {
- proto.RegisterFile("proto3/enum.proto", xxx_File_proto3_enum_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.proto3.Enum", Enum_name, Enum_value)
-}
-
var xxx_File_proto3_enum_proto_rawdesc = []byte{
// 153 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72,
@@ -89,6 +84,8 @@
DependencyIndexes: xxx_File_proto3_enum_proto_depIdxs,
EnumOutputTypes: xxx_File_proto3_enum_proto_enumTypes,
}.Init()
+ proto.RegisterFile("proto3/enum.proto", xxx_File_proto3_enum_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.proto3.Enum", Enum_name, Enum_value)
xxx_File_proto3_enum_proto_goTypes = nil
xxx_File_proto3_enum_proto_depIdxs = nil
}
diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
index d7aa218..b4054cd 100644
--- a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
@@ -410,16 +410,6 @@
var xxx_messageInfo_FieldTestMessage_Message proto.InternalMessageInfo
-func init() {
- proto.RegisterFile("proto3/fields.proto", xxx_File_proto3_fields_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.protoc.proto3.FieldTestMessage_Enum", FieldTestMessage_Enum_name, FieldTestMessage_Enum_value)
- proto.RegisterType((*FieldTestMessage)(nil), "goproto.protoc.proto3.FieldTestMessage")
- proto.RegisterMapType((map[uint64]FieldTestMessage_Enum)(nil), "goproto.protoc.proto3.FieldTestMessage.MapFixed64EnumEntry")
- proto.RegisterMapType((map[int32]int64)(nil), "goproto.protoc.proto3.FieldTestMessage.MapInt32Int64Entry")
- proto.RegisterMapType((map[string]*FieldTestMessage_Message)(nil), "goproto.protoc.proto3.FieldTestMessage.MapStringMessageEntry")
- proto.RegisterType((*FieldTestMessage_Message)(nil), "goproto.protoc.proto3.FieldTestMessage.Message")
-}
-
var xxx_File_proto3_fields_proto_rawdesc = []byte{
// 2378 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e,
@@ -619,6 +609,13 @@
xxx_File_proto3_fields_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
xxx_File_proto3_fields_proto_messageTypes[i].PBType = mt
}
+ proto.RegisterFile("proto3/fields.proto", xxx_File_proto3_fields_proto_rawdesc_gzipped)
+ proto.RegisterEnum("goproto.protoc.proto3.FieldTestMessage_Enum", FieldTestMessage_Enum_name, FieldTestMessage_Enum_value)
+ proto.RegisterType((*FieldTestMessage)(nil), "goproto.protoc.proto3.FieldTestMessage")
+ proto.RegisterMapType((map[uint64]FieldTestMessage_Enum)(nil), "goproto.protoc.proto3.FieldTestMessage.MapFixed64EnumEntry")
+ proto.RegisterMapType((map[int32]int64)(nil), "goproto.protoc.proto3.FieldTestMessage.MapInt32Int64Entry")
+ proto.RegisterMapType((map[string]*FieldTestMessage_Message)(nil), "goproto.protoc.proto3.FieldTestMessage.MapStringMessageEntry")
+ proto.RegisterType((*FieldTestMessage_Message)(nil), "goproto.protoc.proto3.FieldTestMessage.Message")
xxx_File_proto3_fields_proto_goTypes = nil
xxx_File_proto3_fields_proto_depIdxs = nil
}