vartanbeno / go-reddit

Go library for accessing the Reddit API.
Other
306 stars 84 forks source link

undefined: `reddit.DefaultClient` and `reddit.NewDefaultClient` #1

Closed bbkane closed 4 years ago

bbkane commented 4 years ago

For some reason I can't access these? Weird, cause reddit.NewClient works

Steps to Reproduce

Set up Project

$ mkdir repro-go-reddit-bug
$ cd repro-go-reddit-bug
$ go mod init github.com/bbkane/repro-go-reddit-bug
$ go get github.com/vartanbeno/go-reddit

Contents of go.mod:

$ cat go.mod
module github.com/bbkane/repro-go-reddit-bug

go 1.15

require github.com/vartanbeno/go-reddit v1.0.0

Add the following main.go:

$ cat main.go
package main

import "github.com/vartanbeno/go-reddit/reddit"

func main() {
    _, _ = reddit.NewReadonlyClient()
}

Run Project, See Error

$ go run main.go
# command-line-arguments
./main.go:6:9: undefined: reddit.NewReadonlyClient

Go Version

$ go version
go version go1.15.1 darwin/amd64
vartanbeno commented 4 years ago

Hello! Thanks for raising this issue.

I think it's because you're using v1.0.0, which doesn't have those features. I've made quite a few commits to the master branch since tagging that release, so it should work with the latest version of the code. I plan on tagging a new release in the near future.

To pull the code at a specific commit, you can run:

go get github.com/vartanbeno/go-reddit@commit-hash

Thanks for using the package, and let me know if the issue persists.

bbkane commented 4 years ago

yes, go get github.com/vartanbeno/go-reddit@a9e42b2 works for me! Thank you - my plan to make a wallpaper downloader continues! If you remember, would you do me a favor and comment here once you tag another release? If you don't remember, no worries, I'll try to remember to check every once in a while 😁

vartanbeno commented 4 years ago

@bbkane Great! I'm glad it works. And sure thing, I'll let you know once a new release is tagged.

bbkane commented 3 years ago

btw, thought you'd like to see what I'm using this for: https://github.com/bbkane/grabbit . It's actually amazing how much I enjoy seeing new wallpapers every 15m on my setup. Thanks again for this library!

vartanbeno commented 3 years ago

@bbkane That's awesome! I'm gonna check it out 👊

vartanbeno commented 3 years ago

Hey! I know it's been a long time, but just letting you know that I tagged a new release, v2.0.0.

bbkane commented 3 years ago

Oh that's wonderful! I'll upgrade grabbit! Thanks! Ben

On Sun, Jan 24, 2021, 20:09 Vartan Benohanian notifications@github.com wrote:

Hey! I know it's been a long time, but just letting you know that I tagged a new release, v2.0.0 https://github.com/vartanbeno/go-reddit/releases/tag/v2.0.0.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vartanbeno/go-reddit/issues/1#issuecomment-766526577, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOMUPM5N4WULKGIW57WHBTS3TVHHANCNFSM4Q2DKZVA .

bbkane commented 3 years ago

Took way too long (especially considering how easy it was), but grabbit is now updated!