From d476980148be2c1d79fd97a496450e62dd1b333c Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Mon, 30 Mar 2026 19:00:17 +0100 Subject: [PATCH] fix(cmd/version): handle fprintf error in version output Wrap the version printing in fprintf with error check to prevent silent failures. --- cmd/root.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index cfbca0e..a837216 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -42,7 +42,10 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "Print the version information", Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("grokkit version %s (commit %s)\\n", version.Version, version.Commit) + _, err := fmt.Fprintf(os.Stdout, "grokkit version %s (commit %s)\n", version.Version, version.Commit) + if err != nil { + return + } }, }