go-reddit icon indicating copy to clipboard operation
go-reddit copied to clipboard

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

Open mathisve opened this issue 6 years ago • 1 comments

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.

mathisve avatar Aug 25 '19 02:08 mathisve

@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 💃

painhardcore avatar Sep 04 '19 21:09 painhardcore