From 170d6e7c0e496aeed4e85060a03a3b7d532ca82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Z=C3=B6llner?= Date: Mon, 30 Nov 2020 18:07:12 +0100 Subject: [PATCH] Adds custom gogoproto.oneof_moretags option to OneofOptions --- gogoproto/gogo.pb.go | 180 +++++++++++++------------ gogoproto/gogo.proto | 4 + gogoproto/helper.go | 19 +++ protoc-gen-gogo/generator/generator.go | 6 +- 4 files changed, 123 insertions(+), 86 deletions(-) diff --git a/gogoproto/gogo.pb.go b/gogoproto/gogo.pb.go index 1e91766aee..ce9becad63 100644 --- a/gogoproto/gogo.pb.go +++ b/gogoproto/gogo.pb.go @@ -705,6 +705,15 @@ var E_Wktpointer = &proto.ExtensionDesc{ Filename: "gogo.proto", } +var E_OneofMoretags = &proto.ExtensionDesc{ + ExtendedType: (*descriptor.OneofOptions)(nil), + ExtensionType: (*string)(nil), + Field: 67001, + Name: "gogoproto.oneof_moretags", + Tag: "bytes,67001,opt,name=oneof_moretags", + Filename: "gogo.proto", +} + func init() { proto.RegisterExtension(E_GoprotoEnumPrefix) proto.RegisterExtension(E_GoprotoEnumStringer) @@ -782,93 +791,96 @@ func init() { proto.RegisterExtension(E_Stdtime) proto.RegisterExtension(E_Stdduration) proto.RegisterExtension(E_Wktpointer) + proto.RegisterExtension(E_OneofMoretags) } func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) } var fileDescriptor_592445b5231bc2b9 = []byte{ - // 1328 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45, - 0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9, - 0x3e, 0x45, 0x28, 0x65, 0x45, 0x96, 0x63, 0x39, 0x56, 0x10, 0x0e, 0xc6, 0x89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 0xb0, 0xbe, 0x4a, 0x8a, 0x54, 0x8b, - 0xe7, 0x0c, 0x1b, 0x90, 0x51, 0xb0, 0x21, 0x23, 0x9b, 0x4d, 0x5c, 0x46, 0x03, 0x43, 0x04, 0x04, - 0xd3, 0xac, 0x66, 0x9b, 0x88, 0x37, 0x36, 0xe9, 0x78, 0x50, 0x06, 0x16, 0xd8, 0x08, 0x15, 0x28, - 0x5f, 0x46, 0x16, 0x8a, 0x37, 0x51, 0x31, 0xac, 0x61, 0x78, 0x1b, 0x4a, 0xa4, 0xca, 0x13, 0x36, - 0x92, 0xb7, 0xe8, 0x36, 0x10, 0xc1, 0x50, 0x36, 0x45, 0xe4, 0xae, 0xd9, 0x19, 0xde, 0xa6, 0x50, - 0x12, 0x03, 0x8a, 0x39, 0x36, 0x14, 0x3a, 0x49, 0xba, 0xe6, 0x04, 0x56, 0xe9, 0x78, 0x07, 0x1d, - 0x83, 0x25, 0x84, 0x11, 0xc9, 0xa2, 0x5e, 0x34, 0xef, 0x52, 0x44, 0x34, 0x0c, 0x8f, 0x5e, 0xaa, - 0x9c, 0x66, 0x20, 0x1a, 0xbd, 0xd8, 0xde, 0xa3, 0xa3, 0x57, 0xb0, 0x8b, 0xba, 0x71, 0x9a, 0xd5, - 0x52, 0xff, 0x8c, 0x95, 0xe6, 0x7d, 0xca, 0x74, 0x0e, 0x00, 0x7c, 0x0f, 0xbb, 0xae, 0x6b, 0x9b, - 0xb0, 0x90, 0x7d, 0x80, 0xb2, 0x89, 0x2e, 0xad, 0x02, 0x4b, 0x42, 0xaf, 0xca, 0x0f, 0xa9, 0x24, - 0x88, 0x8a, 0x6b, 0x89, 0x8d, 0x67, 0x51, 0xea, 0xac, 0xf6, 0x16, 0xb5, 0x8f, 0x28, 0x6a, 0x05, - 0xdb, 0x11, 0xb5, 0x13, 0x6c, 0x02, 0x8d, 0xbd, 0xe5, 0xf5, 0x63, 0x2a, 0xac, 0x05, 0xbd, 0xd2, - 0x99, 0xdd, 0xfb, 0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0xc1, 0x84, 0xd5, 0x7c, 0x86, 0xb1, 0xe2, 0xd5, 0x08, 0x84, 0xd9, 0xc4, - 0xfe, 0xbe, 0x5d, 0xbc, 0xa5, 0xd1, 0x90, 0xb6, 0x20, 0x4f, 0x8a, 0x41, 0xb0, 0xd9, 0x29, 0xc8, - 0x33, 0x72, 0x90, 0xf5, 0xdd, 0x9f, 0xca, 0x48, 0x39, 0x9e, 0x89, 0xfe, 0x03, 0x69, 0x5a, 0x0f, - 0x01, 0x0b, 0x65, 0x22, 0x94, 0xe3, 0xa5, 0x26, 0xf6, 0x4f, 0x64, 0x4b, 0x00, 0x60, 0xd7, 0x49, - 0x95, 0xcd, 0x7d, 0xff, 0x45, 0x30, 0x01, 0xb0, 0x69, 0xb8, 0x5e, 0x17, 0x1b, 0x26, 0xf6, 0x6f, - 0xda, 0x34, 0xae, 0xe7, 0x87, 0x58, 0x0d, 0x2e, 0xf3, 0xb7, 0x4a, 0x26, 0xf8, 0x1f, 0x84, 0xdb, - 0x04, 0x7c, 0x73, 0xaa, 0x5a, 0xca, 0x37, 0x07, 0xfb, 0x5f, 0xcc, 0x34, 0xad, 0xe7, 0xb3, 0x6c, - 0x20, 0x55, 0xad, 0x56, 0x86, 0xf3, 0xa9, 0x01, 0xff, 0x6f, 0xbb, 0x7c, 0x65, 0x51, 0x32, 0x90, - 0xed, 0x07, 0xd7, 0x55, 0x2c, 0xfd, 0x48, 0x89, 0xc4, 0x64, 0xd8, 0x42, 0x83, 0x86, 0x1c, 0x9e, - 0x67, 0x63, 0xae, 0x0c, 0xab, 0xdc, 0x61, 0xb6, 0x20, 0x17, 0xe4, 0x52, 0x5e, 0x67, 0xee, 0xbd, - 0xd9, 0xf3, 0xd5, 0x5a, 0xd6, 0x9c, 0x74, 0x65, 0x38, 0x05, 0xbf, 0x3c, 0xda, 0x2f, 0x54, 0xcb, - 0xdf, 0x21, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xaf, 0x70, 0x4e, 0x83, 0x15, 0x00, 0x00, + // 1355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0xc9, 0x6f, 0x1c, 0x45, + 0x17, 0xc0, 0xf5, 0xe9, 0x4b, 0x14, 0xfb, 0x79, 0x8b, 0xed, 0x10, 0x42, 0x04, 0x22, 0x70, 0xe2, + 0xe4, 0x9c, 0x22, 0x94, 0xb2, 0xa2, 0xc8, 0xb1, 0x1c, 0x2b, 0x08, 0x27, 0xc6, 0x89, 0xc3, 0x76, + 0x18, 0xf5, 0xcc, 0x94, 0xdb, 0x8d, 0xbb, 0xbb, 0x86, 0xee, 0xea, 0x10, 0xe7, 0x86, 0xc2, 0x22, + 0x14, 0xb1, 0x23, 0x41, 0x42, 0x12, 0x08, 0x88, 0x7d, 0x0d, 0xfb, 0x72, 0xe1, 0xc2, 0x72, 0xe5, + 0x7f, 0xe0, 0x02, 0x98, 0xdd, 0x37, 0x5f, 0xd0, 0xeb, 0x7e, 0xaf, 0xa7, 0xa6, 0x3d, 0xa2, 0x6a, + 0x6e, 0xed, 0x71, 0xfd, 0x7e, 0x53, 0xfd, 0x5e, 0xd7, 0x7b, 0x6f, 0x1a, 0xc0, 0x57, 0xbe, 0x9a, + 0x68, 0x25, 0x4a, 0xab, 0xb1, 0x7e, 0xbc, 0xce, 0x2f, 0x77, 0xef, 0xf1, 0x95, 0xf2, 0x43, 0xb9, + 0x37, 0xff, 0xab, 0x9e, 0x2d, 0xed, 0x6d, 0xca, 0xb4, 0x91, 0x04, 0x2d, 0xad, 0x92, 0x62, 0xb1, + 0x38, 0x0a, 0xe3, 0xb4, 0xb8, 0x26, 0xe3, 0x2c, 0xaa, 0xb5, 0x12, 0xb9, 0x14, 0x9c, 0x1e, 0xbb, + 0x7e, 0xa2, 0x20, 0x27, 0x98, 0x9c, 0x98, 0x89, 0xb3, 0xe8, 0x58, 0x4b, 0x07, 0x2a, 0x4e,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 0xaf, 0x2c, 0x4a, + 0x06, 0xb3, 0xfd, 0xc0, 0x8a, 0x6e, 0xa9, 0x20, 0xd6, 0x32, 0xb1, 0x19, 0xd6, 0xc9, 0x60, 0x20, + 0xe2, 0x30, 0x0c, 0xab, 0x58, 0xaa, 0xa5, 0xda, 0x7f, 0x24, 0xee, 0x18, 0x2e, 0x28, 0x27, 0xdb, + 0x73, 0xc5, 0xab, 0xb8, 0xa1, 0x1c, 0x9b, 0x23, 0xea, 0xd0, 0x0c, 0x8c, 0x37, 0x54, 0x54, 0x45, + 0x0f, 0xc1, 0xac, 0x9a, 0x55, 0xf3, 0x79, 0xbd, 0xba, 0xe7, 0x66, 0x3f, 0xd0, 0xcb, 0x59, 0x7d, + 0xa2, 0xa1, 0xa2, 0xbd, 0xf8, 0x0b, 0xa6, 0xfd, 0x62, 0xb6, 0xfc, 0x3d, 0xf3, 0x6f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x4c, 0x69, 0xec, 0x1a, 0xcb, 0x15, 0x00, 0x00, } diff --git a/gogoproto/gogo.proto b/gogoproto/gogo.proto index b80c85653f..0132217f76 100644 --- a/gogoproto/gogo.proto +++ b/gogoproto/gogo.proto @@ -142,3 +142,7 @@ extend google.protobuf.FieldOptions { optional bool wktpointer = 65012; } + +extend google.protobuf.OneofOptions { + optional string oneof_moretags = 67001; +} \ No newline at end of file diff --git a/gogoproto/helper.go b/gogoproto/helper.go index 390d4e4be6..8689d1eec0 100644 --- a/gogoproto/helper.go +++ b/gogoproto/helper.go @@ -288,6 +288,25 @@ func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string { return nil } +func GetOneOfMoreTags(oneofField *google_protobuf.OneofDescriptorProto) string { + if oneofField == nil { + return "" + } + + if oneofField.Options != nil { + v, err := proto.GetExtension(oneofField.Options, E_OneofMoretags) + if err != nil { + return "" + } + + if ptr, ok := v.(*string); ok{ + return *ptr + } + } + + return "" +} + type EnableFunc func(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { diff --git a/protoc-gen-gogo/generator/generator.go b/protoc-gen-gogo/generator/generator.go index ab07ed61ef..34b7f49642 100644 --- a/protoc-gen-gogo/generator/generator.go +++ b/protoc-gen-gogo/generator/generator.go @@ -2871,13 +2871,15 @@ func (g *Generator) generateMessage(message *Descriptor) { // when we've computed any disambiguation. dname := "is" + goTypeName + "_" + fname - oneOftag := `protobuf_oneof:"` + odp.GetName() + `"` + oneofTag := `protobuf_oneof:"` + odp.GetName() + `"` + oneofMoreTags := gogoproto.GetOneOfMoreTags(odp) + oneofTags := fmt.Sprintf("%s %s", oneofTag, oneofMoreTags) of := oneofField{ fieldCommon: fieldCommon{ goName: fname, getterName: gname, goType: dname, - tags: oneOftag, + tags: oneofTags, protoName: odp.GetName(), fullPath: oneofFullPath, protoField: field,