about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-05-28 14:25:29 +0530
committerAndinus <andinus@nand.sh>2020-05-28 14:25:29 +0530
commit54db84abcc522149dd27d51f89dc590836abee9c (patch)
tree98cef0b1e934d06c5e5dc45caa2a45b3a02b4303
parent8d43f74db37784779530a5dfdf3585d91a7ec31d (diff)
downloadmyCovidCLI-54db84abcc522149dd27d51f89dc590836abee9c.tar.gz
Print error to stderr
-rw-r--r--myCovidCLI.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/myCovidCLI.go b/myCovidCLI.go
index 4ae927c..fbd06db 100644
--- a/myCovidCLI.go
+++ b/myCovidCLI.go
@@ -77,20 +77,20 @@ func main() {
 			confirmed, err := strconv.Atoi(line[7]) //convert confirmed to int
 			if err != nil {
 				// handle error
-				fmt.Println(err)
+				fmt.Fprintln(os.Stderr, err)
 				os.Exit(2)
 			}
 			deaths, err := strconv.Atoi(line[8]) //convert deaths to int
 			if err != nil {
 				// handle error
-				fmt.Println(err)
+				fmt.Fprintln(os.Stderr, err)
 				os.Exit(2)
 			}
 
 			recovered, err := strconv.Atoi(line[9]) //convert recovered to int
 			if err != nil {
 				// handle error
-				fmt.Println(err)
+				fmt.Fprintln(os.Stderr, err)
 				os.Exit(2)
 			}