diff --git a/google/appengine.go b/google/appengine.go index 850e0c0..fb46b5c 100644 --- a/google/appengine.go +++ b/google/appengine.go @@ -34,5 +34,5 @@ var appengineAppIDFunc func(c context.Context) string // context and scopes are not used. Please use DefaultTokenSource (or ComputeTokenSource, // which DefaultTokenSource will use in this case) instead. func AppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - return getAppEngineTokenSource(ctx, scope...) + return appEngineTokenSource(ctx, scope...) } diff --git a/google/appengine_gen1.go b/google/appengine_gen1.go index 8dc00b1..1ca0517 100644 --- a/google/appengine_gen1.go +++ b/google/appengine_gen1.go @@ -24,10 +24,10 @@ func init() { } // See comment on AppEngineTokenSource in appengine.go. -func getAppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { +func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { scopes := append([]string{}, scope...) sort.Strings(scopes) - return &appEngineTokenSource{ + return &gaeTokenSource{ ctx: ctx, scopes: scopes, key: strings.Join(scopes, " "), @@ -45,13 +45,13 @@ type tokenLock struct { t *oauth2.Token } -type appEngineTokenSource struct { +type gaeTokenSource struct { ctx context.Context scopes []string key string // to aeTokens map; space-separated scopes } -func (ts *appEngineTokenSource) Token() (*oauth2.Token, error) { +func (ts *gaeTokenSource) Token() (*oauth2.Token, error) { aeTokensMu.Lock() tok, ok := aeTokens[ts.key] if !ok { diff --git a/google/appengine_gen2_flex.go b/google/appengine_gen2_flex.go index 215b314..728c911 100644 --- a/google/appengine_gen2_flex.go +++ b/google/appengine_gen2_flex.go @@ -25,7 +25,7 @@ var ( ) // See comment on AppEngineTokenSource in appengine.go. -func getAppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { +func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { once.Do(logFunc) return ComputeTokenSource("") }