From 48280e828bc4737a91ed556226f7fdcb52679f87 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 22 Feb 2026 19:09:25 +0200 Subject: Enforce Go best practices (task 344) - Magefile.go: add Default() target so bare `mage` builds the binary; fix Install()/Uninstall() to use $GOPATH/bin (default ~/go/bin) instead of the previous hardcoded ~/.local/bin path; use cp -v for visibility; fix 0755 -> 0o755 octal literal in createBinDir; extract binaryName const - cmd/geheim/main.go: add -version flag (prints version.Version and exits); pass flag.Args() instead of os.Args[1:] so flags are parsed cleanly - internal/cli/cli.go: remove dead fatal() and prompt() helpers that were never called anywhere in the codebase Co-Authored-By: Claude Sonnet 4.6 --- internal/cli/cli.go | 6 ------ 1 file changed, 6 deletions(-) (limited to 'internal/cli') diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 7d59b94..0ae4dde 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -679,9 +679,3 @@ func logMsg(msg string) { fmt.Printf("> %s\n", msg) } // warn prints a "WARN " prefixed message to stderr. func warn(msg string) { fmt.Fprintf(os.Stderr, "WARN %s\n", msg) } - -// fatal prints a "FATAL " prefixed message to stderr and exits with code 3. -func fatal(msg string) { fmt.Fprintf(os.Stderr, "FATAL %s\n", msg); os.Exit(3) } - -// prompt prints a prompt string without a trailing newline. -func prompt(msg string) { fmt.Printf("< %s", msg) } -- cgit v1.2.3