cmd/protoc-gen-go: drop xxx_ prefix for package-level variables
Lower-casing the FileDescriptor variable provides for shorter and
more readable global variable names. This has a very minor benefit
that the read-only data section of a binary is slightly smaller
since function names do end up in the final binary.
Change-Id: I077364905e5c9adea69873b3ea580fddc68b9eb8
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/172119
Reviewed-by: Herbie Ong <herbie@google.com>
diff --git a/internal/testprotos/test/test_weak.pb.go b/internal/testprotos/test/test_weak.pb.go
index 541908c..b36082b 100644
--- a/internal/testprotos/test/test_weak.pb.go
+++ b/internal/testprotos/test/test_weak.pb.go
@@ -30,21 +30,21 @@
func (*WeakImportMessage) ProtoMessage() {}
func (x *WeakImportMessage) ProtoReflect() protoreflect.Message {
- return xxx_File_test_test_weak_proto_messageTypes[0].MessageOf(x)
+ return file_test_test_weak_proto_msgTypes[0].MessageOf(x)
}
func (m *WeakImportMessage) XXX_Methods() *protoiface.Methods {
- return xxx_File_test_test_weak_proto_messageTypes[0].Methods()
+ return file_test_test_weak_proto_msgTypes[0].Methods()
}
// Deprecated: Use WeakImportMessage.ProtoReflect.Type instead.
func (*WeakImportMessage) Descriptor() ([]byte, []int) {
- return xxx_File_test_test_weak_proto_rawDescGZIP(), []int{0}
+ return file_test_test_weak_proto_rawDescGZIP(), []int{0}
}
var File_test_test_weak_proto protoreflect.FileDescriptor
-var xxx_File_test_test_weak_proto_rawDesc = []byte{
+var file_test_test_weak_proto_rawDesc = []byte{
0x0a, 0x14, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x61, 0x6b,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x57, 0x65,
@@ -56,37 +56,37 @@
}
var (
- xxx_File_test_test_weak_proto_rawDesc_once sync.Once
- xxx_File_test_test_weak_proto_rawDesc_data = xxx_File_test_test_weak_proto_rawDesc
+ file_test_test_weak_proto_rawDescOnce sync.Once
+ file_test_test_weak_proto_rawDescData = file_test_test_weak_proto_rawDesc
)
-func xxx_File_test_test_weak_proto_rawDescGZIP() []byte {
- xxx_File_test_test_weak_proto_rawDesc_once.Do(func() {
- xxx_File_test_test_weak_proto_rawDesc_data = protoimpl.X.CompressGZIP(xxx_File_test_test_weak_proto_rawDesc_data)
+func file_test_test_weak_proto_rawDescGZIP() []byte {
+ file_test_test_weak_proto_rawDescOnce.Do(func() {
+ file_test_test_weak_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_test_weak_proto_rawDescData)
})
- return xxx_File_test_test_weak_proto_rawDesc_data
+ return file_test_test_weak_proto_rawDescData
}
-var xxx_File_test_test_weak_proto_messageTypes = make([]protoimpl.MessageType, 1)
-var xxx_File_test_test_weak_proto_goTypes = []interface{}{
+var file_test_test_weak_proto_msgTypes = make([]protoimpl.MessageType, 1)
+var file_test_test_weak_proto_goTypes = []interface{}{
(*WeakImportMessage)(nil), // 0: goproto.proto.test.WeakImportMessage
}
-var xxx_File_test_test_weak_proto_depIdxs = []int32{}
+var file_test_test_weak_proto_depIdxs = []int32{}
-func init() { xxx_File_test_test_weak_proto_init() }
-func xxx_File_test_test_weak_proto_init() {
+func init() { file_test_test_weak_proto_init() }
+func file_test_test_weak_proto_init() {
if File_test_test_weak_proto != nil {
return
}
File_test_test_weak_proto = protoimpl.FileBuilder{
- RawDescriptor: xxx_File_test_test_weak_proto_rawDesc,
- GoTypes: xxx_File_test_test_weak_proto_goTypes,
- DependencyIndexes: xxx_File_test_test_weak_proto_depIdxs,
- MessageOutputTypes: xxx_File_test_test_weak_proto_messageTypes,
+ RawDescriptor: file_test_test_weak_proto_rawDesc,
+ GoTypes: file_test_test_weak_proto_goTypes,
+ DependencyIndexes: file_test_test_weak_proto_depIdxs,
+ MessageOutputTypes: file_test_test_weak_proto_msgTypes,
FilesRegistry: protoregistry.GlobalFiles,
TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- xxx_File_test_test_weak_proto_rawDesc = nil
- xxx_File_test_test_weak_proto_goTypes = nil
- xxx_File_test_test_weak_proto_depIdxs = nil
+ file_test_test_weak_proto_rawDesc = nil
+ file_test_test_weak_proto_goTypes = nil
+ file_test_test_weak_proto_depIdxs = nil
}