fix(cmd/version): handle fprintf error in version output
All checks were successful
CI / Test (push) Successful in 34s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 21s
Release / Create Release (push) Successful in 36s

Wrap the version printing in fprintf with error check to prevent silent failures.
This commit is contained in:
Greg Gauthier 2026-03-30 19:00:17 +01:00
parent 7055a23ca2
commit d476980148

View File

@ -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
}
},
}