Selaa lähdekoodia

Fix echo example (#2025)

Motivation:

The v2 echo example accidentally ignored the response message and
printed the text from the input message.

Modifications:

- Use the response message

Result:

Fewer warnings
George Barnett 1 vuosi sitten
vanhempi
commit
e3258e9357
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Examples/v2/echo/Subcommands/Get.swift

+ 1 - 1
Examples/v2/echo/Subcommands/Get.swift

@@ -41,7 +41,7 @@ struct Get: AsyncParsableCommand {
         let message = Echo_EchoRequest.with { $0.text = self.arguments.message }
         print("get → \(message.text)")
         let response = try await echo.get(message)
-        print("get ← \(message.text)")
+        print("get ← \(response.text)")
       }
 
       client.close()