From 6d8f8ea9d22ed767c0b6179b23a654e390cfe7e9 Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Tue, 5 Aug 2014 12:25:29 -0700 Subject: [PATCH] Avoid concatenating scope literals. --- google/appengine.go | 4 +--- google/appenginevm.go | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/google/appengine.go b/google/appengine.go index df4efd1..09f327c 100644 --- a/google/appengine.go +++ b/google/appengine.go @@ -3,8 +3,6 @@ package google import ( - "strings" - "github.com/golang/oauth2" "appengine" @@ -43,7 +41,7 @@ func (c *AppEngineConfig) NewTransport() oauth2.Transport { // FetchToken fetches a new access token for the provided scopes. func (c *AppEngineConfig) FetchToken(existing *oauth2.Token) (*oauth2.Token, error) { - token, expiry, err := appengine.AccessToken(c.context, strings.Join(c.scopes, " ")) + token, expiry, err := appengine.AccessToken(c.context, c.scopes...) if err != nil { return nil, err } diff --git a/google/appenginevm.go b/google/appenginevm.go index 96c65fe..d2e0626 100644 --- a/google/appenginevm.go +++ b/google/appenginevm.go @@ -4,7 +4,6 @@ package google import ( "net/http" - "strings" "github.com/golang/oauth2" "google.golang.org/appengine" @@ -31,7 +30,7 @@ func (c *AppEngineConfig) NewTransport() oauth2.Transport { // FetchToken fetches a new access token for the provided scopes. func (c *AppEngineConfig) FetchToken(existing *oauth2.Token) (*oauth2.Token, error) { - token, expiry, err := appengine.AccessToken(c.context, strings.Join(c.scopes, " ")) + token, expiry, err := appengine.AccessToken(c.context, c.scopes...) if err != nil { return nil, err }