From 63401cf45cb809648c3bdf8644c1d21043fb22f8 Mon Sep 17 00:00:00 2001 From: Arkadiy Tetelman Date: Sun, 1 Jan 2023 12:13:32 -0800 Subject: [PATCH] Use fully qualified names for inputs --- pkg/protodump/fixtures/test.proto | 4 ++-- pkg/protodump/proto.go | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/protodump/fixtures/test.proto b/pkg/protodump/fixtures/test.proto index 552db03..283e037 100644 --- a/pkg/protodump/fixtures/test.proto +++ b/pkg/protodump/fixtures/test.proto @@ -5,8 +5,8 @@ package hello.world; option go_package = "./;helloworld"; service Greeter { - rpc SayHello (HelloRequest) returns (HelloReply) {} - rpc StreamMethodServer (StreamRequest) returns (stream StreamReply) {} + rpc SayHello (.hello.world.HelloRequest) returns (.hello.world.HelloReply) {} + rpc StreamMethodServer (.hello.world.StreamRequest) returns (stream .hello.world.StreamReply) {} } message Reserved { diff --git a/pkg/protodump/proto.go b/pkg/protodump/proto.go index b0fc313..5100d7f 100644 --- a/pkg/protodump/proto.go +++ b/pkg/protodump/proto.go @@ -55,12 +55,14 @@ func (pd *ProtoDefinition) writeMethod(method protoreflect.MethodDescriptor) { if method.IsStreamingClient() { pd.write("stream ") } - pd.write(string(method.Input().Name())) + pd.write(".") + pd.write(string(method.Input().FullName())) pd.write(") returns (") if method.IsStreamingServer() { pd.write("stream ") } - pd.write(string(method.Output().Name())) + pd.write(".") + pd.write(string(method.Output().FullName())) pd.write(") {}\n") }