protoc-gen-go: simplify init function generation (#716)
We generate a single init function containing registration calls for
all the things in a .pb.go that need one (messages, extensions, etc.)
Some of these registrations are added to a list as the generator processes
the type that needs to be registered (e.g., messages.) Some are added at
the end while generating the init function (e.g., enums). Extensions
are done in both places.
Make this consistent and always generate the registration functions
during processing. This simplifies the code a bit, and makes it easier
for a new generator to be consistent with its output.
No changes to the number of init functions, just the order of
registration calls in the existing one.
diff --git a/conformance/internal/conformance_proto/conformance.pb.go b/conformance/internal/conformance_proto/conformance.pb.go
index db5628c..6b4a361 100644
--- a/conformance/internal/conformance_proto/conformance.pb.go
+++ b/conformance/internal/conformance_proto/conformance.pb.go
@@ -1648,6 +1648,9 @@
}
func init() {
+ proto.RegisterEnum("conformance.WireFormat", WireFormat_name, WireFormat_value)
+ proto.RegisterEnum("conformance.ForeignEnum", ForeignEnum_name, ForeignEnum_value)
+ proto.RegisterEnum("conformance.TestAllTypes_NestedEnum", TestAllTypes_NestedEnum_name, TestAllTypes_NestedEnum_value)
proto.RegisterType((*ConformanceRequest)(nil), "conformance.ConformanceRequest")
proto.RegisterType((*ConformanceResponse)(nil), "conformance.ConformanceResponse")
proto.RegisterType((*TestAllTypes)(nil), "conformance.TestAllTypes")
@@ -1672,9 +1675,6 @@
proto.RegisterMapType((map[uint64]uint64)(nil), "conformance.TestAllTypes.MapUint64Uint64Entry")
proto.RegisterType((*TestAllTypes_NestedMessage)(nil), "conformance.TestAllTypes.NestedMessage")
proto.RegisterType((*ForeignMessage)(nil), "conformance.ForeignMessage")
- proto.RegisterEnum("conformance.WireFormat", WireFormat_name, WireFormat_value)
- proto.RegisterEnum("conformance.ForeignEnum", ForeignEnum_name, ForeignEnum_value)
- proto.RegisterEnum("conformance.TestAllTypes_NestedEnum", TestAllTypes_NestedEnum_name, TestAllTypes_NestedEnum_value)
}
func init() { proto.RegisterFile("conformance.proto", fileDescriptor_e7c910178d599565) }
diff --git a/jsonpb/jsonpb_test_proto/more_test_objects.pb.go b/jsonpb/jsonpb_test_proto/more_test_objects.pb.go
index dab08c4..9309bf3 100644
--- a/jsonpb/jsonpb_test_proto/more_test_objects.pb.go
+++ b/jsonpb/jsonpb_test_proto/more_test_objects.pb.go
@@ -316,6 +316,7 @@
}
func init() {
+ proto.RegisterEnum("jsonpb.Numeral", Numeral_name, Numeral_value)
proto.RegisterType((*Simple3)(nil), "jsonpb.Simple3")
proto.RegisterType((*SimpleSlice3)(nil), "jsonpb.SimpleSlice3")
proto.RegisterType((*SimpleMap3)(nil), "jsonpb.SimpleMap3")
@@ -332,7 +333,6 @@
proto.RegisterMapType((map[string]string)(nil), "jsonpb.Mappy.StrryEntry")
proto.RegisterMapType((map[uint32]bool)(nil), "jsonpb.Mappy.U32boolyEntry")
proto.RegisterMapType((map[uint64]bool)(nil), "jsonpb.Mappy.U64boolyEntry")
- proto.RegisterEnum("jsonpb.Numeral", Numeral_name, Numeral_value)
}
func init() { proto.RegisterFile("more_test_objects.proto", fileDescriptor_e6c135db3023e377) }
diff --git a/jsonpb/jsonpb_test_proto/test_objects.pb.go b/jsonpb/jsonpb_test_proto/test_objects.pb.go
index ddd0954..d9f918f 100644
--- a/jsonpb/jsonpb_test_proto/test_objects.pb.go
+++ b/jsonpb/jsonpb_test_proto/test_objects.pb.go
@@ -1255,6 +1255,7 @@
}
func init() {
+ proto.RegisterEnum("jsonpb.Widget_Color", Widget_Color_name, Widget_Color_value)
proto.RegisterType((*Simple)(nil), "jsonpb.Simple")
proto.RegisterType((*NonFinites)(nil), "jsonpb.NonFinites")
proto.RegisterType((*Repeats)(nil), "jsonpb.Repeats")
@@ -1264,6 +1265,7 @@
proto.RegisterMapType((map[int64]string)(nil), "jsonpb.Maps.MInt64StrEntry")
proto.RegisterType((*MsgWithOneof)(nil), "jsonpb.MsgWithOneof")
proto.RegisterType((*Real)(nil), "jsonpb.Real")
+ proto.RegisterExtension(E_Complex_RealExtension)
proto.RegisterType((*Complex)(nil), "jsonpb.Complex")
proto.RegisterType((*KnownTypes)(nil), "jsonpb.KnownTypes")
proto.RegisterType((*MsgWithRequired)(nil), "jsonpb.MsgWithRequired")
@@ -1271,8 +1273,6 @@
proto.RegisterMapType((map[string]*MsgWithRequired)(nil), "jsonpb.MsgWithIndirectRequired.MapFieldEntry")
proto.RegisterType((*MsgWithRequiredBytes)(nil), "jsonpb.MsgWithRequiredBytes")
proto.RegisterType((*MsgWithRequiredWKT)(nil), "jsonpb.MsgWithRequiredWKT")
- proto.RegisterEnum("jsonpb.Widget_Color", Widget_Color_name, Widget_Color_value)
- proto.RegisterExtension(E_Complex_RealExtension)
proto.RegisterExtension(E_Name)
proto.RegisterExtension(E_Extm)
}
diff --git a/proto/proto3_proto/proto3.pb.go b/proto/proto3_proto/proto3.pb.go
index 7ebf5b6..c3a9b09 100644
--- a/proto/proto3_proto/proto3.pb.go
+++ b/proto/proto3_proto/proto3.pb.go
@@ -542,6 +542,7 @@
}
func init() {
+ proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value)
proto.RegisterType((*Message)(nil), "proto3_proto.Message")
proto.RegisterMapType((map[string]*test_proto.SubDefaults)(nil), "proto3_proto.Message.Proto2ValueEntry")
proto.RegisterMapType((map[string]string)(nil), "proto3_proto.Message.StringMapEntry")
@@ -555,7 +556,6 @@
proto.RegisterType((*TestUTF8)(nil), "proto3_proto.TestUTF8")
proto.RegisterMapType((map[string]int64)(nil), "proto3_proto.TestUTF8.MapKeyEntry")
proto.RegisterMapType((map[int64]string)(nil), "proto3_proto.TestUTF8.MapValueEntry")
- proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value)
}
func init() { proto.RegisterFile("proto3_proto/proto3.proto", fileDescriptor_1c50d9b824d4ac38) }
diff --git a/proto/test_proto/test.pb.go b/proto/test_proto/test.pb.go
index 2fe5af1..3b9012a 100644
--- a/proto/test_proto/test.pb.go
+++ b/proto/test_proto/test.pb.go
@@ -4930,6 +4930,12 @@
}
func init() {
+ proto.RegisterEnum("test_proto.FOO", FOO_name, FOO_value)
+ proto.RegisterEnum("test_proto.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value)
+ proto.RegisterEnum("test_proto.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value)
+ proto.RegisterEnum("test_proto.DefaultsMessage_DefaultsEnum", DefaultsMessage_DefaultsEnum_name, DefaultsMessage_DefaultsEnum_value)
+ proto.RegisterEnum("test_proto.Defaults_Color", Defaults_Color_name, Defaults_Color_value)
+ proto.RegisterEnum("test_proto.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value)
proto.RegisterType((*GoEnum)(nil), "test_proto.GoEnum")
proto.RegisterType((*GoTestField)(nil), "test_proto.GoTestField")
proto.RegisterType((*GoTest)(nil), "test_proto.GoTest")
@@ -4952,6 +4958,9 @@
proto.RegisterType((*RequiredInnerMessage)(nil), "test_proto.RequiredInnerMessage")
proto.RegisterType((*MyMessage)(nil), "test_proto.MyMessage")
proto.RegisterType((*MyMessage_SomeGroup)(nil), "test_proto.MyMessage.SomeGroup")
+ proto.RegisterExtension(E_Ext_More)
+ proto.RegisterExtension(E_Ext_Text)
+ proto.RegisterExtension(E_Ext_Number)
proto.RegisterType((*Ext)(nil), "test_proto.Ext")
proto.RegisterMapType((map[int32]int32)(nil), "test_proto.Ext.MapFieldEntry")
proto.RegisterType((*ComplexExtension)(nil), "test_proto.ComplexExtension")
@@ -4981,15 +4990,6 @@
proto.RegisterType((*TestUTF8)(nil), "test_proto.TestUTF8")
proto.RegisterMapType((map[string]int64)(nil), "test_proto.TestUTF8.MapKeyEntry")
proto.RegisterMapType((map[int64]string)(nil), "test_proto.TestUTF8.MapValueEntry")
- proto.RegisterEnum("test_proto.FOO", FOO_name, FOO_value)
- proto.RegisterEnum("test_proto.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value)
- proto.RegisterEnum("test_proto.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value)
- proto.RegisterEnum("test_proto.DefaultsMessage_DefaultsEnum", DefaultsMessage_DefaultsEnum_name, DefaultsMessage_DefaultsEnum_value)
- proto.RegisterEnum("test_proto.Defaults_Color", Defaults_Color_name, Defaults_Color_value)
- proto.RegisterEnum("test_proto.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value)
- proto.RegisterExtension(E_Ext_More)
- proto.RegisterExtension(E_Ext_Text)
- proto.RegisterExtension(E_Ext_Number)
proto.RegisterExtension(E_Greeting)
proto.RegisterExtension(E_Complex)
proto.RegisterExtension(E_RComplex)
diff --git a/protoc-gen-go/descriptor/descriptor.pb.go b/protoc-gen-go/descriptor/descriptor.pb.go
index 8f4382e..a560e9e 100644
--- a/protoc-gen-go/descriptor/descriptor.pb.go
+++ b/protoc-gen-go/descriptor/descriptor.pb.go
@@ -2661,6 +2661,12 @@
}
func init() {
+ proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
+ proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
+ proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
+ proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
+ proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
+ proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet")
proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto")
proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto")
@@ -2688,12 +2694,6 @@
proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location")
proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo")
proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation")
- proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
- proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
- proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
- proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
- proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
- proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
}
func init() { proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_e5baabe45344a177) }
diff --git a/protoc-gen-go/generator/generator.go b/protoc-gen-go/generator/generator.go
index eb880ab..825381c 100644
--- a/protoc-gen-go/generator/generator.go
+++ b/protoc-gen-go/generator/generator.go
@@ -1423,6 +1423,8 @@
g.P("func (", ccTypeName, `) XXX_WellKnownType() string { return "`, enum.GetName(), `" }`)
g.P()
}
+
+ g.generateEnumRegistration(enum)
}
// The tag is a string like "varint,2,opt,name=fieldname,def=7" that
@@ -2797,6 +2799,7 @@
g.P("}")
g.P()
+ g.addInitf("%s.RegisterExtension(%s)", g.Pkg["proto"], ext.DescName())
if mset {
// Generate a bit more code to register with message_set.go.
g.addInitf("%s.RegisterMessageSetType((%s)(nil), %d, %q)", g.Pkg["proto"], fieldType, *field.Number, extName)
@@ -2806,17 +2809,6 @@
}
func (g *Generator) generateInitFunction() {
- for _, enum := range g.file.enum {
- g.generateEnumRegistration(enum)
- }
- for _, d := range g.file.desc {
- for _, ext := range d.ext {
- g.generateExtensionRegistration(ext)
- }
- }
- for _, ext := range g.file.ext {
- g.generateExtensionRegistration(ext)
- }
if len(g.init) == 0 {
return
}
@@ -2880,10 +2872,6 @@
g.addInitf("%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)", g.Pkg["proto"], pkg+ccTypeName, ccTypeName)
}
-func (g *Generator) generateExtensionRegistration(ext *ExtensionDescriptor) {
- g.addInitf("%s.RegisterExtension(%s)", g.Pkg["proto"], ext.DescName())
-}
-
// And now lots of helper functions.
// Is c an ASCII lower-case letter?
diff --git a/protoc-gen-go/testdata/deprecated/deprecated.pb.go b/protoc-gen-go/testdata/deprecated/deprecated.pb.go
index bce051d..bd5678a 100644
--- a/protoc-gen-go/testdata/deprecated/deprecated.pb.go
+++ b/protoc-gen-go/testdata/deprecated/deprecated.pb.go
@@ -127,9 +127,9 @@
}
func init() {
+ proto.RegisterEnum("deprecated.DeprecatedEnum", DeprecatedEnum_name, DeprecatedEnum_value)
proto.RegisterType((*DeprecatedRequest)(nil), "deprecated.DeprecatedRequest")
proto.RegisterType((*DeprecatedResponse)(nil), "deprecated.DeprecatedResponse")
- proto.RegisterEnum("deprecated.DeprecatedEnum", DeprecatedEnum_name, DeprecatedEnum_value)
}
// Reference imports to suppress errors if they are not otherwise used.
diff --git a/protoc-gen-go/testdata/extension_user/extension_user.pb.go b/protoc-gen-go/testdata/extension_user/extension_user.pb.go
index 76ff5e4..2f7fe3a 100644
--- a/protoc-gen-go/testdata/extension_user/extension_user.pb.go
+++ b/protoc-gen-go/testdata/extension_user/extension_user.pb.go
@@ -352,16 +352,16 @@
func init() {
proto.RegisterType((*UserMessage)(nil), "extension_user.UserMessage")
+ proto.RegisterExtension(E_LoudMessage_Volume)
proto.RegisterType((*LoudMessage)(nil), "extension_user.LoudMessage")
+ proto.RegisterExtension(E_LoginMessage_UserMessage)
proto.RegisterType((*LoginMessage)(nil), "extension_user.LoginMessage")
proto.RegisterType((*Detail)(nil), "extension_user.Detail")
+ proto.RegisterExtension(E_Announcement_LoudExt)
proto.RegisterType((*Announcement)(nil), "extension_user.Announcement")
+ proto.RegisterExtension(E_OldStyleParcel_MessageSetExtension)
proto.RegisterMessageSetType((*OldStyleParcel)(nil), 2001, "extension_user.OldStyleParcel")
proto.RegisterType((*OldStyleParcel)(nil), "extension_user.OldStyleParcel")
- proto.RegisterExtension(E_LoudMessage_Volume)
- proto.RegisterExtension(E_LoginMessage_UserMessage)
- proto.RegisterExtension(E_Announcement_LoudExt)
- proto.RegisterExtension(E_OldStyleParcel_MessageSetExtension)
proto.RegisterExtension(E_UserMessage)
proto.RegisterExtension(E_ExtraMessage)
proto.RegisterExtension(E_Width)
diff --git a/protoc-gen-go/testdata/import_public/sub/a.pb.go b/protoc-gen-go/testdata/import_public/sub/a.pb.go
index 3b79b36..990b01f 100644
--- a/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ b/protoc-gen-go/testdata/import_public/sub/a.pb.go
@@ -368,11 +368,11 @@
}
func init() {
- proto.RegisterType((*M)(nil), "goproto.test.import_public.sub.M")
- proto.RegisterType((*M_Submessage)(nil), "goproto.test.import_public.sub.M.Submessage")
proto.RegisterEnum("goproto.test.import_public.sub.E", E_name, E_value)
proto.RegisterEnum("goproto.test.import_public.sub.M_Subenum", M_Subenum_name, M_Subenum_value)
proto.RegisterEnum("goproto.test.import_public.sub.M_Submessage_Submessage_Subenum", M_Submessage_Submessage_Subenum_name, M_Submessage_Submessage_Subenum_value)
+ proto.RegisterType((*M)(nil), "goproto.test.import_public.sub.M")
+ proto.RegisterType((*M_Submessage)(nil), "goproto.test.import_public.sub.M.Submessage")
}
func init() { proto.RegisterFile("import_public/sub/a.proto", fileDescriptor_382f7805394b5c4e) }
diff --git a/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
index 9043697..174854b 100644
--- a/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
+++ b/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
@@ -113,9 +113,9 @@
}
func init() {
+ 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")
- proto.RegisterEnum("test.a.E1", E1_name, E1_value)
}
func init() { proto.RegisterFile("imports/test_a_1/m1.proto", fileDescriptor_c1091de3fa870a14) }
diff --git a/protoc-gen-go/testdata/multi/multi2.pb.go b/protoc-gen-go/testdata/multi/multi2.pb.go
index 07ec0a6..27a2352 100644
--- a/protoc-gen-go/testdata/multi/multi2.pb.go
+++ b/protoc-gen-go/testdata/multi/multi2.pb.go
@@ -111,8 +111,8 @@
}
func init() {
- proto.RegisterType((*Multi2)(nil), "multitest.Multi2")
proto.RegisterEnum("multitest.Multi2_Color", Multi2_Color_name, Multi2_Color_value)
+ proto.RegisterType((*Multi2)(nil), "multitest.Multi2")
}
func init() { proto.RegisterFile("multi/multi2.proto", fileDescriptor_a2aebe588a0b2853) }
diff --git a/protoc-gen-go/testdata/multi/multi3.pb.go b/protoc-gen-go/testdata/multi/multi3.pb.go
index 8dbd30a..ae3a1ff 100644
--- a/protoc-gen-go/testdata/multi/multi3.pb.go
+++ b/protoc-gen-go/testdata/multi/multi3.pb.go
@@ -100,8 +100,8 @@
}
func init() {
- proto.RegisterType((*Multi3)(nil), "multitest.Multi3")
proto.RegisterEnum("multitest.Multi3_HatType", Multi3_HatType_name, Multi3_HatType_value)
+ proto.RegisterType((*Multi3)(nil), "multitest.Multi3")
}
func init() { proto.RegisterFile("multi/multi3.proto", fileDescriptor_580398fc0bbeeaa7) }
diff --git a/protoc-gen-go/testdata/my_test/test.pb.go b/protoc-gen-go/testdata/my_test/test.pb.go
index 54e65bd..b241933 100644
--- a/protoc-gen-go/testdata/my_test/test.pb.go
+++ b/protoc-gen-go/testdata/my_test/test.pb.go
@@ -1123,6 +1123,10 @@
}
func init() {
+ proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value)
+ proto.RegisterEnum("my.test.Days", Days_name, Days_value)
+ proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value)
+ proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
proto.RegisterType((*Request)(nil), "my.test.Request")
proto.RegisterMapType((map[int64]*Reply)(nil), "my.test.Request.MsgMappingEntry")
proto.RegisterMapType((map[int32]string)(nil), "my.test.Request.NameMappingEntry")
@@ -1130,19 +1134,15 @@
proto.RegisterType((*Reply)(nil), "my.test.Reply")
proto.RegisterType((*Reply_Entry)(nil), "my.test.Reply.Entry")
proto.RegisterType((*OtherBase)(nil), "my.test.OtherBase")
+ proto.RegisterExtension(E_ReplyExtensions_Time)
+ proto.RegisterExtension(E_ReplyExtensions_Carrot)
+ proto.RegisterExtension(E_ReplyExtensions_Donut)
proto.RegisterType((*ReplyExtensions)(nil), "my.test.ReplyExtensions")
proto.RegisterType((*OtherReplyExtensions)(nil), "my.test.OtherReplyExtensions")
proto.RegisterType((*OldReply)(nil), "my.test.OldReply")
proto.RegisterType((*Communique)(nil), "my.test.Communique")
proto.RegisterType((*Communique_SomeGroup)(nil), "my.test.Communique.SomeGroup")
proto.RegisterType((*Communique_Delta)(nil), "my.test.Communique.Delta")
- proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value)
- proto.RegisterEnum("my.test.Days", Days_name, Days_value)
- proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value)
- proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
- proto.RegisterExtension(E_ReplyExtensions_Time)
- proto.RegisterExtension(E_ReplyExtensions_Carrot)
- proto.RegisterExtension(E_ReplyExtensions_Donut)
proto.RegisterExtension(E_Tag)
proto.RegisterExtension(E_Donut)
}
diff --git a/protoc-gen-go/testdata/proto3/proto3.pb.go b/protoc-gen-go/testdata/proto3/proto3.pb.go
index 2eb572c..fcce2e6 100644
--- a/protoc-gen-go/testdata/proto3/proto3.pb.go
+++ b/protoc-gen-go/testdata/proto3/proto3.pb.go
@@ -170,9 +170,9 @@
}
func init() {
+ proto.RegisterEnum("proto3.Request_Flavour", Request_Flavour_name, Request_Flavour_value)
proto.RegisterType((*Request)(nil), "proto3.Request")
proto.RegisterType((*Book)(nil), "proto3.Book")
- proto.RegisterEnum("proto3.Request_Flavour", Request_Flavour_name, Request_Flavour_value)
}
func init() { proto.RegisterFile("proto3/proto3.proto", fileDescriptor_ab04eb4084a521db) }
diff --git a/ptypes/struct/struct.pb.go b/ptypes/struct/struct.pb.go
index 323707c..a56fb70 100644
--- a/ptypes/struct/struct.pb.go
+++ b/ptypes/struct/struct.pb.go
@@ -418,11 +418,11 @@
}
func init() {
+ proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
proto.RegisterMapType((map[string]*Value)(nil), "google.protobuf.Struct.FieldsEntry")
proto.RegisterType((*Value)(nil), "google.protobuf.Value")
proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
- proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
}
func init() { proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_df322afd6c9fb402) }