Skip to content

Commit

Permalink
chore: catch error during write to stdout
Browse files Browse the repository at this point in the history
Signed-off-by: Ardika Bagus <[email protected]>
  • Loading branch information
ardikabs committed Nov 3, 2023
1 parent 45b5b5e commit 0de0385
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ func run(cmd *cobra.Command, args []string) error {
generatedObjects = append(generatedObjects, generated...)
}

os.Stdout.Write([]byte(generatedObjects.String()))
if _, err := os.Stdout.Write([]byte(generatedObjects.String())); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 0de0385

Please sign in to comment.