Skip to content
This repository was archived by the owner on Sep 18, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math/rand"
Expand Down Expand Up @@ -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))
}

Expand All @@ -67,4 +68,4 @@ func getData(body []byte) (*ShitPost, error) {
log.Println("error:", err)
}
return s, err
}
}