From eb474416d326a65d839700d82edb44728c9d5249 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 5 Sep 2022 23:07:06 +0000 Subject: [PATCH] You will be fortunate in everything you put your hands to. git-svn-id: file:///srv/svn/repo/mima/trunk@7 d2428f92-30f9-164c-8098-19ee57ce342c --- main.go | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 1195f69..8cb8482 100644 --- a/main.go +++ b/main.go @@ -10,23 +10,13 @@ package main import ( "fmt" "os" - "os/exec" "log" + "runtime" ) func main() { - // "Uh" - getOS, erros := exec.Command("uname", "-sr").Output() - getArch, errarch := exec.Command("uname", "-m").Output() getHost, errhost := os.Hostname() - // At least it works \_(=^.^=)_/ - if erros != nil { - log.Fatal(erros) - } - if errarch != nil { - log.Fatal(errarch) - } if errhost != nil { log.Fatal(errhost) } @@ -34,8 +24,8 @@ func main() { // Pretty-print output fmt.Printf("%s (%d) @ %s", os.Getenv("USER"), os.Getuid(), getHost) fmt.Printf("\n") - fmt.Printf("Editor: %s \n", os.Getenv("EDITOR")) - fmt.Printf("Operating System: %s", getOS) - fmt.Printf("Architecture: %s", getArch) - fmt.Printf("Shell: %s \n", os.Getenv("SHELL")) + fmt.Printf("Editor: %s\n", os.Getenv("EDITOR")) + fmt.Printf("Operating System: %s\n", runtime.GOOS) + fmt.Printf("Architecture: %s\n", runtime.GOARCH) + fmt.Printf("Shell: %s\n", os.Getenv("SHELL")) }