From 1837b10bfc21764a6f3c881fadf6807c854c1c76 Mon Sep 17 00:00:00 2001 From: Joshua Humphries Date: Wed, 16 Feb 2022 21:56:18 -0500 Subject: [PATCH] Improvements to recently introduced sourceinfo stuff (#500) The `desc.Load*` functions now return descriptors that include source info, if available (i.e. if protoc-gen-gosrcinfo plugin is used). --- desc/builder/builder_test.go | 5 +++-- desc/load.go | 2 ++ desc/protoparse/linker_test.go | 3 +++ desc/protoprint/testfiles/desc_test2-compact.proto | 2 +- desc/protoprint/testfiles/desc_test2-default.proto | 4 ++-- .../testfiles/desc_test2-multiline-style-comments.proto | 4 ++-- .../testfiles/desc_test2-no-trailing-comments.proto | 4 ++-- .../testfiles/desc_test2-only-doc-comments.proto | 4 ++-- .../testfiles/desc_test2-trailing-on-next-line.proto | 4 ++-- desc/sourceinfo/cmd/protoc-gen-gosrcinfo/main.go | 8 ++------ desc/sourceinfo/srcinforeflection/serverreflection.go | 6 ++++++ dynamic/dynamic_message_test.go | 3 +++ internal/testprotos/desc_test1.pb.srcinfo.go | 2 +- internal/testprotos/desc_test2.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_comments.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_complex.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_defaults.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_field_types.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_oneof.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_options.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_proto3.pb.srcinfo.go | 2 +- internal/testprotos/desc_test_value.pb.srcinfo.go | 2 +- .../testprotos/desc_test_wellknowntypes.pb.srcinfo.go | 2 +- internal/testprotos/grpc/test.pb.srcinfo.go | 2 +- internal/testprotos/nopkg/desc_test_nopkg.pb.srcinfo.go | 2 +- .../testprotos/nopkg/desc_test_nopkg_new.pb.srcinfo.go | 2 +- internal/testprotos/pkg/desc_test_pkg.pb.srcinfo.go | 2 +- 27 files changed, 45 insertions(+), 34 deletions(-) diff --git a/desc/builder/builder_test.go b/desc/builder/builder_test.go index abcfca0a..8d087142 100644 --- a/desc/builder/builder_test.go +++ b/desc/builder/builder_test.go @@ -540,8 +540,9 @@ func roundTripFile(t *testing.T, fd *desc.FileDescriptor) { fdp.PublicDependency = nil fdp.WeakDependency = nil - // Remove source code info that the builder generated since the original - // has none. + // Remove source code info: what the builder generates is not expected to + // match the original source. + fdp.SourceCodeInfo = nil roundTripped.AsFileDescriptorProto().SourceCodeInfo = nil // Finally, sort the imports. That way they match the built result (which diff --git a/desc/load.go b/desc/load.go index 4a05830d..24d3e9b5 100644 --- a/desc/load.go +++ b/desc/load.go @@ -8,6 +8,7 @@ import ( "github.com/golang/protobuf/proto" dpb "github.com/golang/protobuf/protoc-gen-go/descriptor" + "github.com/jhump/protoreflect/desc/sourceinfo" "github.com/jhump/protoreflect/internal" ) @@ -54,6 +55,7 @@ func loadFileDescriptorLocked(file string, r *ImportResolver) (*FileDescriptor, } func toFileDescriptorLocked(fd *dpb.FileDescriptorProto, r *ImportResolver) (*FileDescriptor, error) { + fd.SourceCodeInfo = sourceinfo.SourceInfoForFile(fd.GetName()) deps := make([]*FileDescriptor, len(fd.GetDependency())) for i, dep := range fd.GetDependency() { resolvedDep := r.ResolveImport(fd.GetName(), dep) diff --git a/desc/protoparse/linker_test.go b/desc/protoparse/linker_test.go index 70e1c400..5efd5b9f 100644 --- a/desc/protoparse/linker_test.go +++ b/desc/protoparse/linker_test.go @@ -87,6 +87,9 @@ func checkFiles(t *testing.T, act, exp *desc.FileDescriptor, checked map[string] } checked[act.GetName()] = struct{}{} + // remove any source code info from expected value, since actual won't have any + exp.AsFileDescriptorProto().SourceCodeInfo = nil + testutil.Require(t, proto.Equal(exp.AsFileDescriptorProto(), act.AsProto()), "linked descriptor did not match output from protoc:\nwanted: %s\ngot: %s", toString(exp.AsProto()), toString(act.AsProto())) for i, dep := range act.GetDependencies() { diff --git a/desc/protoprint/testfiles/desc_test2-compact.proto b/desc/protoprint/testfiles/desc_test2-compact.proto index 4a5ec137..c28f62bf 100644 --- a/desc/protoprint/testfiles/desc_test2-compact.proto +++ b/desc/protoprint/testfiles/desc_test2-compact.proto @@ -1,9 +1,9 @@ syntax = "proto2"; +option go_package = "github.com/jhump/protoreflect/internal/testprotos"; package testprotos; import "desc_test1.proto"; import "pkg/desc_test_pkg.proto"; import "nopkg/desc_test_nopkg.proto"; -option go_package = "github.com/jhump/protoreflect/internal/testprotos"; message Frobnitz { optional TestMessage a = 1; optional AnotherTestMessage b = 2; diff --git a/desc/protoprint/testfiles/desc_test2-default.proto b/desc/protoprint/testfiles/desc_test2-default.proto index f17735d1..6db670e8 100644 --- a/desc/protoprint/testfiles/desc_test2-default.proto +++ b/desc/protoprint/testfiles/desc_test2-default.proto @@ -1,5 +1,7 @@ syntax = "proto2"; +option go_package = "github.com/jhump/protoreflect/internal/testprotos"; + package testprotos; import "desc_test1.proto"; @@ -8,8 +10,6 @@ import "pkg/desc_test_pkg.proto"; import "nopkg/desc_test_nopkg.proto"; -option go_package = "github.com/jhump/protoreflect/internal/testprotos"; - message Frobnitz { optional TestMessage a = 1; diff --git a/desc/protoprint/testfiles/desc_test2-multiline-style-comments.proto b/desc/protoprint/testfiles/desc_test2-multiline-style-comments.proto index cf1574d7..f92788a6 100644 --- a/desc/protoprint/testfiles/desc_test2-multiline-style-comments.proto +++ b/desc/protoprint/testfiles/desc_test2-multiline-style-comments.proto @@ -1,5 +1,7 @@ syntax = "proto2"; +option go_package = "github.com/jhump/protoreflect/internal/testprotos"; + package testprotos; import "desc_test1.proto"; @@ -8,8 +10,6 @@ import "pkg/desc_test_pkg.proto"; import "nopkg/desc_test_nopkg.proto"; -option go_package = "github.com/jhump/protoreflect/internal/testprotos"; - message Frobnitz { optional TestMessage a = 1; diff --git a/desc/protoprint/testfiles/desc_test2-no-trailing-comments.proto b/desc/protoprint/testfiles/desc_test2-no-trailing-comments.proto index f17735d1..6db670e8 100644 --- a/desc/protoprint/testfiles/desc_test2-no-trailing-comments.proto +++ b/desc/protoprint/testfiles/desc_test2-no-trailing-comments.proto @@ -1,5 +1,7 @@ syntax = "proto2"; +option go_package = "github.com/jhump/protoreflect/internal/testprotos"; + package testprotos; import "desc_test1.proto"; @@ -8,8 +10,6 @@ import "pkg/desc_test_pkg.proto"; import "nopkg/desc_test_nopkg.proto"; -option go_package = "github.com/jhump/protoreflect/internal/testprotos"; - message Frobnitz { optional TestMessage a = 1; diff --git a/desc/protoprint/testfiles/desc_test2-only-doc-comments.proto b/desc/protoprint/testfiles/desc_test2-only-doc-comments.proto index f17735d1..6db670e8 100644 --- a/desc/protoprint/testfiles/desc_test2-only-doc-comments.proto +++ b/desc/protoprint/testfiles/desc_test2-only-doc-comments.proto @@ -1,5 +1,7 @@ syntax = "proto2"; +option go_package = "github.com/jhump/protoreflect/internal/testprotos"; + package testprotos; import "desc_test1.proto"; @@ -8,8 +10,6 @@ import "pkg/desc_test_pkg.proto"; import "nopkg/desc_test_nopkg.proto"; -option go_package = "github.com/jhump/protoreflect/internal/testprotos"; - message Frobnitz { optional TestMessage a = 1; diff --git a/desc/protoprint/testfiles/desc_test2-trailing-on-next-line.proto b/desc/protoprint/testfiles/desc_test2-trailing-on-next-line.proto index f17735d1..6db670e8 100644 --- a/desc/protoprint/testfiles/desc_test2-trailing-on-next-line.proto +++ b/desc/protoprint/testfiles/desc_test2-trailing-on-next-line.proto @@ -1,5 +1,7 @@ syntax = "proto2"; +option go_package = "github.com/jhump/protoreflect/internal/testprotos"; + package testprotos; import "desc_test1.proto"; @@ -8,8 +10,6 @@ import "pkg/desc_test_pkg.proto"; import "nopkg/desc_test_nopkg.proto"; -option go_package = "github.com/jhump/protoreflect/internal/testprotos"; - message Frobnitz { optional TestMessage a = 1; diff --git a/desc/sourceinfo/cmd/protoc-gen-gosrcinfo/main.go b/desc/sourceinfo/cmd/protoc-gen-gosrcinfo/main.go index 295301a6..cf5cb67b 100644 --- a/desc/sourceinfo/cmd/protoc-gen-gosrcinfo/main.go +++ b/desc/sourceinfo/cmd/protoc-gen-gosrcinfo/main.go @@ -6,13 +6,11 @@ package main import ( "fmt" "path" - "reflect" "strings" "github.com/golang/protobuf/proto" "github.com/jhump/gopoet" "github.com/jhump/goprotoc/plugins" - "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/pluginpb" "github.com/jhump/protoreflect/desc" @@ -61,8 +59,6 @@ func genSourceInfo(req *plugins.CodeGenRequest, resp *plugins.CodeGenResponse) e return nil } -var typeOfSourceInfo = reflect.TypeOf((*descriptorpb.SourceCodeInfo)(nil)).Elem() - func generateSourceInfo(fd *desc.FileDescriptor, names *plugins.GoNames, resp *plugins.CodeGenResponse, args codeGenArgs) error { si := fd.AsFileDescriptorProto().GetSourceCodeInfo() if len(si.GetLocation()) == 0 { @@ -80,7 +76,7 @@ func generateSourceInfo(fd *desc.FileDescriptor, names *plugins.GoNames, resp *p return fmt.Errorf("failed to serialize source code info: %w", err) } - srcCodeInfo := f.EnsureTypeImported(gopoet.TypeNameForReflectType(typeOfSourceInfo)) + descpbPkg := f.RegisterImport("google.golang.org/protobuf/types/descriptorpb", "descriptorpb") srcInfoPkg := f.RegisterImport("github.com/jhump/protoreflect/desc/sourceinfo", "sourceinfo") protoPkg := f.RegisterImport("google.golang.org/protobuf/proto", "proto") @@ -104,7 +100,7 @@ func generateSourceInfo(fd *desc.FileDescriptor, names *plugins.GoNames, resp *p initBlock.Println("}") f.AddVar(gopoet.NewVar(varName).SetInitializer(&initBlock)) f.AddElement(gopoet.NewFunc("init"). - Printlnf("var si %s", srcCodeInfo). + Printlnf("var si %sSourceCodeInfo", descpbPkg). Printlnf("if err := %sUnmarshal(%s, &si); err != nil {", protoPkg, varName). Println(" panic(err)"). Println("}"). diff --git a/desc/sourceinfo/srcinforeflection/serverreflection.go b/desc/sourceinfo/srcinforeflection/serverreflection.go index 3cf02628..1c12795a 100644 --- a/desc/sourceinfo/srcinforeflection/serverreflection.go +++ b/desc/sourceinfo/srcinforeflection/serverreflection.go @@ -2,6 +2,12 @@ // that includes source code info, if the protoc-gen-gosrcinfo plugin was used // for the files that contain the descriptors being served. This allows for // sending comment information to dynamic/reflective clients. +// +// NOTE: This package is EXPERIMENTAL! It may not see the light of day in an +// actual release. Instead, the hope is that the core gRPC reflection package +// can be updated in a way to more easily accommodate customizations, such as +// the caller wanting to use sourceinfo.GlobalFiles as the source of descriptors. +// Related: https://github.com/grpc/grpc-go/pull/5197 package srcinforeflection import ( diff --git a/dynamic/dynamic_message_test.go b/dynamic/dynamic_message_test.go index 42b10158..01228645 100644 --- a/dynamic/dynamic_message_test.go +++ b/dynamic/dynamic_message_test.go @@ -2045,6 +2045,9 @@ func TestGetDescriptor(t *testing.T) { testutil.Eq(t, expectedPath, actualPath, "%s: descriptor paths are not the same", testCase.name) actualFd, err := internal.DecodeFileDescriptor("TestMessage", actualBytes) + // desc.LoadMessageDescriptorForMessage above can incorporate source code info that will + // not be present when directly calling generated messages's Descriptor method + actualFd.SourceCodeInfo = nil testutil.Ok(t, err, "%s: failed to decode descriptor from bytes", testCase.name) expectedFd, err := internal.DecodeFileDescriptor("TestMessage", expectedBytes) testutil.Ok(t, err, "%s: failed to decode descriptor from bytes", testCase.name) diff --git a/internal/testprotos/desc_test1.pb.srcinfo.go b/internal/testprotos/desc_test1.pb.srcinfo.go index 94a61c7e..431444b2 100644 --- a/internal/testprotos/desc_test1.pb.srcinfo.go +++ b/internal/testprotos/desc_test1.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test1 = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x76, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test2.pb.srcinfo.go b/internal/testprotos/desc_test2.pb.srcinfo.go index 3852ba53..66e53aa6 100644 --- a/internal/testprotos/desc_test2.pb.srcinfo.go +++ b/internal/testprotos/desc_test2.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test2 = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x2a, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test_comments.pb.srcinfo.go b/internal/testprotos/desc_test_comments.pb.srcinfo.go index 83342b18..c2991690 100644 --- a/internal/testprotos/desc_test_comments.pb.srcinfo.go +++ b/internal/testprotos/desc_test_comments.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_comments = []byte{ 0x0a, 0x07, 0x12, 0x05, 0x07, 0x00, 0x9b, 0x01, 0x01, 0x0a, 0xa1, 0x01, 0x0a, 0x01, 0x0c, 0x12, diff --git a/internal/testprotos/desc_test_complex.pb.srcinfo.go b/internal/testprotos/desc_test_complex.pb.srcinfo.go index b5bd1a94..b360b81d 100644 --- a/internal/testprotos/desc_test_complex.pb.srcinfo.go +++ b/internal/testprotos/desc_test_complex.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_complex = []byte{ 0x0a, 0x07, 0x12, 0x05, 0x00, 0x00, 0xa7, 0x02, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, diff --git a/internal/testprotos/desc_test_defaults.pb.srcinfo.go b/internal/testprotos/desc_test_defaults.pb.srcinfo.go index c802b3bb..feab0247 100644 --- a/internal/testprotos/desc_test_defaults.pb.srcinfo.go +++ b/internal/testprotos/desc_test_defaults.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_defaults = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x7b, 0x01, 0x0a, 0x09, 0x0a, 0x01, 0x0c, 0x12, 0x04, 0x00, diff --git a/internal/testprotos/desc_test_field_types.pb.srcinfo.go b/internal/testprotos/desc_test_field_types.pb.srcinfo.go index 4206a9eb..e73d5400 100644 --- a/internal/testprotos/desc_test_field_types.pb.srcinfo.go +++ b/internal/testprotos/desc_test_field_types.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_field_types = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x75, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test_oneof.pb.srcinfo.go b/internal/testprotos/desc_test_oneof.pb.srcinfo.go index 022f2aac..5adbc117 100644 --- a/internal/testprotos/desc_test_oneof.pb.srcinfo.go +++ b/internal/testprotos/desc_test_oneof.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_oneof = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x11, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test_options.pb.srcinfo.go b/internal/testprotos/desc_test_options.pb.srcinfo.go index ec83a54e..95c04ff6 100644 --- a/internal/testprotos/desc_test_options.pb.srcinfo.go +++ b/internal/testprotos/desc_test_options.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_options = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x3e, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test_proto3.pb.srcinfo.go b/internal/testprotos/desc_test_proto3.pb.srcinfo.go index c1db6a68..2c48449f 100644 --- a/internal/testprotos/desc_test_proto3.pb.srcinfo.go +++ b/internal/testprotos/desc_test_proto3.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_proto3 = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x22, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test_value.pb.srcinfo.go b/internal/testprotos/desc_test_value.pb.srcinfo.go index 898d75b5..59e4c7a6 100644 --- a/internal/testprotos/desc_test_value.pb.srcinfo.go +++ b/internal/testprotos/desc_test_value.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_value = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x0b, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/desc_test_wellknowntypes.pb.srcinfo.go b/internal/testprotos/desc_test_wellknowntypes.pb.srcinfo.go index 9ddaad01..4e0393fd 100644 --- a/internal/testprotos/desc_test_wellknowntypes.pb.srcinfo.go +++ b/internal/testprotos/desc_test_wellknowntypes.pb.srcinfo.go @@ -5,7 +5,7 @@ package testprotos import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_desc_test_wellknowntypes = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x1d, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/grpc/test.pb.srcinfo.go b/internal/testprotos/grpc/test.pb.srcinfo.go index 4c43de26..5d7ac300 100644 --- a/internal/testprotos/grpc/test.pb.srcinfo.go +++ b/internal/testprotos/grpc/test.pb.srcinfo.go @@ -5,7 +5,7 @@ package grpc import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_grpc_test = []byte{ 0x0a, 0x07, 0x12, 0x05, 0x10, 0x00, 0xe5, 0x01, 0x01, 0x0a, 0xb8, 0x05, 0x0a, 0x01, 0x0c, 0x12, diff --git a/internal/testprotos/nopkg/desc_test_nopkg.pb.srcinfo.go b/internal/testprotos/nopkg/desc_test_nopkg.pb.srcinfo.go index 75c124c9..bbab4429 100644 --- a/internal/testprotos/nopkg/desc_test_nopkg.pb.srcinfo.go +++ b/internal/testprotos/nopkg/desc_test_nopkg.pb.srcinfo.go @@ -5,7 +5,7 @@ package nopkg import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_nopkg_desc_test_nopkg = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x04, 0x30, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/nopkg/desc_test_nopkg_new.pb.srcinfo.go b/internal/testprotos/nopkg/desc_test_nopkg_new.pb.srcinfo.go index 31d1a7bc..26516cd0 100644 --- a/internal/testprotos/nopkg/desc_test_nopkg_new.pb.srcinfo.go +++ b/internal/testprotos/nopkg/desc_test_nopkg_new.pb.srcinfo.go @@ -5,7 +5,7 @@ package nopkg import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_nopkg_desc_test_nopkg_new = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x16, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, diff --git a/internal/testprotos/pkg/desc_test_pkg.pb.srcinfo.go b/internal/testprotos/pkg/desc_test_pkg.pb.srcinfo.go index 9e4df791..86598276 100644 --- a/internal/testprotos/pkg/desc_test_pkg.pb.srcinfo.go +++ b/internal/testprotos/pkg/desc_test_pkg.pb.srcinfo.go @@ -5,7 +5,7 @@ package pkg import "github.com/jhump/protoreflect/desc/sourceinfo" import "google.golang.org/protobuf/proto" -import descriptorpb "google.golang.org/protobuf/types/descriptorpb" +import "google.golang.org/protobuf/types/descriptorpb" var srcInfo_pkg_desc_test_pkg = []byte{ 0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x14, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00,