Use Credentials struct for NewClient

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2021-01-24 22:51:27 -05:00
parent 78dc97a8d5
commit 6d615771cb
6 changed files with 34 additions and 52 deletions
+2 -3
View File
@@ -17,9 +17,8 @@ func main() {
}
func run() (err error) {
withCredentials := reddit.WithCredentials("id", "secret", "username", "password")
client, err := reddit.NewClient(withCredentials)
credentials := reddit.Credentials{ID: "id", Secret: "secret", Username: "username", Password: "password"}
client, err := reddit.NewClient(credentials)
if err != nil {
return
}