From 4c723d8bc87b4e8877e340356f71a4a89611434c Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Sun, 2 Jun 2024 00:59:56 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Write=20cli=20executable=20?= =?UTF-8?q?as=20a=20go=20program.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 3 +++ main.go | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 go.mod create mode 100644 main.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a927b75 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/netrisdotme/cli + +go 1.22.2 diff --git a/main.go b/main.go new file mode 100644 index 0000000..87ada5b --- /dev/null +++ b/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "runtime" +) + +func main() { + + switch runtime.GOOS { + case "windows": + //This is where we should build our nestri "nest" + fmt.Println("You're on Windows!") + case "darwin": + //do nothing (probably deploy to AWS, Vast.ai and the rest) plus Linux & Windows + fmt.Println("You're on macOS!") + case "linux": + //This is where we should build our nestri "server" + fmt.Println("You're on Linux!") + default: + fmt.Printf("Unsupported operating system: %s\n", runtime.GOOS) + } +}