Browse Source

Fix HelloWorld Samples (#1505)

* Fixed HelloWorld samples

- Samples were not starting up without a main function

* Fixed code review comments
Sam Amin 3 years ago
parent
commit
4915076adf

+ 1 - 0
Sources/Examples/HelloWorld/Client/main.swift → Sources/Examples/HelloWorld/Client/helloworldclient.swift

@@ -20,6 +20,7 @@ import HelloWorldModel
 import NIOCore
 import NIOPosix
 
+@main
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
 struct HelloWorld: AsyncParsableCommand {
   @Option(help: "The port to connect to")

+ 1 - 0
Sources/Examples/HelloWorld/Server/main.swift → Sources/Examples/HelloWorld/Server/HelloWorldServer.swift

@@ -20,6 +20,7 @@ import HelloWorldModel
 import NIOCore
 import NIOPosix
 
+@main
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
 struct HelloWorld: AsyncParsableCommand {
   @Option(help: "The port to listen on for new connections")