send error message to standard error out

This commit is contained in:
Maidul Islam
2023-02-14 13:43:40 -08:00
parent fba54ae0c6
commit 0c10bbb569
4 changed files with 15 additions and 27 deletions
+3 -3
View File
@@ -31,10 +31,10 @@ func PrintSuccessMessage(message string) {
color.New(color.FgGreen).Println(message)
}
func PrintMessageAndExit(messages ...string) {
func PrintErrorMessageAndExit(messages ...string) {
if len(messages) > 0 {
for _, message := range messages {
fmt.Println(message)
fmt.Fprintln(os.Stderr, message)
}
}
@@ -42,5 +42,5 @@ func PrintMessageAndExit(messages ...string) {
}
func printError(e error) {
color.Red("Hmm, we ran into an error: %v", e)
color.New(color.FgRed).Fprintf(os.Stderr, "Hmm, we ran into an error: %v", e)
}