From 5779afb167d6abe13c29bb9632c9ac516a817e49 Mon Sep 17 00:00:00 2001 From: Michael Traver Date: Wed, 31 Oct 2018 11:50:34 -0700 Subject: [PATCH] Address review comments --- google/appengine_gen2_flex.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/google/appengine_gen2_flex.go b/google/appengine_gen2_flex.go index 728c911..819aa68 100644 --- a/google/appengine_gen2_flex.go +++ b/google/appengine_gen2_flex.go @@ -16,16 +16,12 @@ import ( "golang.org/x/oauth2" ) -var ( - once sync.Once - - logFunc = func() { - log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") - } -) +var logOnce sync.Once // only spam about deprecation once // See comment on AppEngineTokenSource in appengine.go. func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - once.Do(logFunc) + logOnce.Do(func() { + log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") + }) return ComputeTokenSource("") }