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
This commit is contained in:
admin 2022-09-05 23:07:06 +00:00
parent db8b3589ca
commit eb474416d3

20
main.go
View File

@ -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"))
}