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:
Vartan Benohanian
2020-11-01 22:25:13 -05:00
parent 8fe2410f4a
commit 78dc97a8d5
6 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ func TestNewReadonlyClient_Error(t *testing.T) {
}
func TestDefaultClient(t *testing.T) {
require.NotNil(t, DefaultClient)
require.NotNil(t, DefaultClient())
}
func TestClient_Readonly_NewRequest(t *testing.T) {