Use fully qualified names for inputs

This commit is contained in:
Arkadiy Tetelman committed 2023-01-01 12:16:05 -08:00
1 parent 446d6a6c52
commit 63401cf45c
2 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -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 {
+4 -2
View File
@@ -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")
}