cmd/protoc-gen-go: remove generation of XXX_OneofWrappers

Associate the oneof wrapper types with a message by conveying that
information to the associated MessageInfo.

Change-Id: Iabfca593850e1d6a89498a37eacbf22dbb73bd20
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/185239
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index 359f459..9fa7865 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -976,21 +976,6 @@
 	return TestAllTypes_FOO
 }
 
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*TestAllTypes) XXX_OneofWrappers() []interface{} {
-	return []interface{}{
-		(*TestAllTypes_OneofUint32)(nil),
-		(*TestAllTypes_OneofNestedMessage)(nil),
-		(*TestAllTypes_OneofString)(nil),
-		(*TestAllTypes_OneofBytes)(nil),
-		(*TestAllTypes_OneofBool)(nil),
-		(*TestAllTypes_OneofUint64)(nil),
-		(*TestAllTypes_OneofFloat)(nil),
-		(*TestAllTypes_OneofDouble)(nil),
-		(*TestAllTypes_OneofEnum)(nil),
-	}
-}
-
 type isTestAllTypes_OneofField interface {
 	isTestAllTypes_OneofField()
 }
@@ -1106,13 +1091,6 @@
 	return 0
 }
 
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*TestDeprecatedMessage) XXX_OneofWrappers() []interface{} {
-	return []interface{}{
-		(*TestDeprecatedMessage_DeprecatedOneofField)(nil),
-	}
-}
-
 type isTestDeprecatedMessage_DeprecatedOneof interface {
 	isTestDeprecatedMessage_DeprecatedOneof()
 }
@@ -1446,13 +1424,6 @@
 	return nil
 }
 
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*TestRequiredForeign) XXX_OneofWrappers() []interface{} {
-	return []interface{}{
-		(*TestRequiredForeign_OneofMessage)(nil),
-	}
-}
-
 type isTestRequiredForeign_OneofField interface {
 	isTestRequiredForeign_OneofField()
 }
@@ -3504,6 +3475,23 @@
 	}
 	file_test_test_import_proto_init()
 	file_test_test_public_proto_init()
+	file_test_test_proto_msgTypes[0].OneofWrappers = []interface{}{
+		(*TestAllTypes_OneofUint32)(nil),
+		(*TestAllTypes_OneofNestedMessage)(nil),
+		(*TestAllTypes_OneofString)(nil),
+		(*TestAllTypes_OneofBytes)(nil),
+		(*TestAllTypes_OneofBool)(nil),
+		(*TestAllTypes_OneofUint64)(nil),
+		(*TestAllTypes_OneofFloat)(nil),
+		(*TestAllTypes_OneofDouble)(nil),
+		(*TestAllTypes_OneofEnum)(nil),
+	}
+	file_test_test_proto_msgTypes[1].OneofWrappers = []interface{}{
+		(*TestDeprecatedMessage_DeprecatedOneofField)(nil),
+	}
+	file_test_test_proto_msgTypes[9].OneofWrappers = []interface{}{
+		(*TestRequiredForeign_OneofMessage)(nil),
+	}
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 			RawDescriptor: file_test_test_proto_rawDesc,