cameronstanley / go-reddit

Golang Reddit API Wrapper
MIT License
18 stars 12 forks source link

json: cannot unmarshal number 1564777310.0 into Go struct field Link.created of type int[] #5

Open mathisve opened 5 years ago

mathisve commented 5 years ago

All im trying to do is get the top posts of a subreddit. This is my code:

package main

import(
    "fmt"
    "github.com/cameronstanley/go-reddit"
)

func main() {
    client := reddit.NoAuthClient
    links, err := client.GetHotLinks("funny")
    if err != nil {
        fmt.Println(err)
    }
    fmt.Println(links)
}

But I keep getting this error: json: cannot unmarshal number 1564777310.0 into Go struct field Link.created of type int [] I'm not sure if I'm doing something wrong or if there's a bug somewhere thats causing this.

painhardcore commented 5 years ago

@Mathisco-01 hi, I've had a similar issue and fixed this issue in my fork I don't think if it's correct fix, but it worked for my case 💃