From 4f73db950a77461e453c66b9bb38e927b7bc8897 Mon Sep 17 00:00:00 2001 From: Divyansh Date: Thu, 25 Jun 2020 16:37:33 +0530 Subject: [PATCH] use fmt to print instead of log --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 28883c7..5788383 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "fmt" "io/ioutil" "log" "math/rand" @@ -56,7 +57,7 @@ func main() { randomPost := rand.Intn(100 - 1) + 1 // TODO: make the first number (max) depend on how many "Children" structs are returned post := s.Data.Children[randomPost].Post - log.Println(chalk.Yellow(post.Title), "\n", + fmt.Println(chalk.Yellow(post.Title), "\n", chalk.Blue(post.Text)) } @@ -67,4 +68,4 @@ func getData(body []byte) (*ShitPost, error) { log.Println("error:", err) } return s, err -} \ No newline at end of file +}