From 75f52a8d5912388de4cc8b5f60064dcfdb3a9f7c Mon Sep 17 00:00:00 2001 From: Michael Traver Date: Wed, 31 Oct 2018 11:21:18 -0700 Subject: [PATCH] Rename getAppEngineTokenSource and appEngineTokenSource appEngineTokenSource -> gaeTokenSource getAppEngineTokenSource -> appEngineTokenSource --- google/appengine.go | 2 +- google/appengine_gen1.go | 8 ++++---- google/appengine_gen2_flex.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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("") }