fix(cmd/version): handle fprintf error in version output
Wrap the version printing in fprintf with error check to prevent silent failures.
This commit is contained in:
parent
7055a23ca2
commit
d476980148
@ -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
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user