From b36998e141bc8adb4cfd1c4ba76b4bb283bfded7 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 6 Sep 2022 21:18:31 +0000 Subject: [PATCH] A 6-char limit is like night. git-svn-id: file:///srv/svn/repo/mima/trunk@8 d2428f92-30f9-164c-8098-19ee57ce342c --- Makefile | 2 +- main.go => cmd/antifetch/main.go | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) rename main.go => cmd/antifetch/main.go (72%) diff --git a/Makefile b/Makefile index 90d3fe0..a41b03e 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PREFIX=/usr/local OUTPUT=antifetch build: - go build -v -o ${OUTPUT} + go build -v ./cmd/${OUTPUT} clean: rm -f ${OUTPUT} install: diff --git a/main.go b/cmd/antifetch/main.go similarity index 72% rename from main.go rename to cmd/antifetch/main.go index 8cb8482..9866fc8 100644 --- a/main.go +++ b/cmd/antifetch/main.go @@ -15,14 +15,12 @@ import ( ) func main() { - getHost, errhost := os.Hostname() + host, err := os.Hostname() - if errhost != nil { - log.Fatal(errhost) + if err != nil { + log.Fatal(err) } - - // Pretty-print output - fmt.Printf("%s (%d) @ %s", os.Getenv("USER"), os.Getuid(), getHost) + fmt.Printf("%s (%d) @ %s", os.Getenv("USER"), os.Getuid(), host) fmt.Printf("\n") fmt.Printf("Editor: %s\n", os.Getenv("EDITOR")) fmt.Printf("Operating System: %s\n", runtime.GOOS)