Make DefaultClient a method that returns the global default client
I made this a method to prevent other users from reassigning the previously exported DefaultClient, e.g. doing something like: ```go reddit.DefaultClient = nil ``` Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
@@ -60,7 +60,7 @@ client, _ := reddit.NewClient(withCredentials, reddit.WithHTTPClient(httpClient)
|
||||
|
||||
### Read-Only Mode
|
||||
|
||||
The global `DefaultClient` variable is a valid, read-only client with limited access to the Reddit API, much like a logged out user. You can initialize your own via `NewReadonlyClient`:
|
||||
The `DefaultClient` method returns a valid, read-only client with limited access to the Reddit API, much like a logged out user. You can initialize your own and configure it further using options via `NewReadonlyClient`:
|
||||
|
||||
```go
|
||||
client, _ := reddit.NewReadonlyClient()
|
||||
|
||||
Reference in New Issue
Block a user