diff --git a/reddit/reddit-oauth.go b/reddit/reddit-oauth.go index 18abf1e..a74444d 100644 --- a/reddit/reddit-oauth.go +++ b/reddit/reddit-oauth.go @@ -122,7 +122,7 @@ func oauthTransport(client *Client) (*oauth2.Transport, error) { transport := &oauth2.Transport{Base: client.client.Transport} switch client.appType { - case ScriptApp: + case Script: transport.Source = oauth2.ReuseTokenSource(nil, &oauthTokenSource{ ctx: ctx, config: config, diff --git a/reddit/reddit.go b/reddit/reddit.go index 7ba7e2c..c7ae5a0 100644 --- a/reddit/reddit.go +++ b/reddit/reddit.go @@ -45,7 +45,7 @@ const ( type AppType int const ( - ScriptApp AppType = iota // default to "Script app" for compatibility + Script AppType = iota // default to "Script" for backward compatibility WebApp ) @@ -129,7 +129,7 @@ func newClient() *Client { baseURL, _ := url.Parse(defaultBaseURL) tokenURL, _ := url.Parse(defaultTokenURL) - client := &Client{client: &http.Client{}, BaseURL: baseURL, TokenURL: tokenURL, appType: ScriptApp} + client := &Client{client: &http.Client{}, BaseURL: baseURL, TokenURL: tokenURL, appType: Script} client.Account = &AccountService{client: client} client.Collection = &CollectionService{client: client}