Skip to content

Commit

Permalink
Merge pull request #7 from alex-slynko/master
Browse files Browse the repository at this point in the history
Print errors in stderr
  • Loading branch information
Julian Skupnjak authored Jan 25, 2021
2 parents b6e30aa + 9f3ba1a commit 2cbee60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/goml/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func getPaths(c *cli.Context) {
func exitWithError(err error) {
if err != nil {
r := color.New(color.FgHiRed)
r.Println(err)
r.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
3 changes: 2 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -42,7 +43,7 @@ func ExtractType(value *simpleyaml.Yaml) (interface{}, error) {
func extractArrayType(value interface{}) string {
switch t := value.(type) {
default:
fmt.Printf("unexpected type %T\n", t)
fmt.Fprintf(os.Stderr, "unexpected type %T\n", t)
case string:
return value.(string)
case bool:
Expand Down

0 comments on commit 2cbee60

Please sign in to comment.