Skip to content

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

Description

@mathisve

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions