Skip to content

Commit 2c6e83d

Browse files
author
Joe Burianek
authored
Merge pull request #63 from dfreilich/patch-2
Avoid writing error to Stdout
2 parents d50eab4 + bc66012 commit 2c6e83d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

autotag/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ func main() {
5050
})
5151

5252
if err != nil {
53-
fmt.Println("Error initializing: ", err)
53+
log.SetOutput(os.Stderr)
54+
log.Println("Error initializing: " + err.Error())
5455
os.Exit(1)
5556
}
5657

5758
// Tag unless asked otherwise
5859
if !opts.JustVersion {
5960
err = r.AutoTag()
6061
if err != nil {
61-
fmt.Println("Error auto updating version: ", err.Error())
62+
log.SetOutput(os.Stderr)
63+
log.Println("Error auto updating version: " + err.Error())
6264
os.Exit(1)
6365
}
6466
}

0 commit comments

Comments
 (0)