From 6f4df59c513530af54ccbf90c24ef913311d82fa Mon Sep 17 00:00:00 2001 From: Guillaume Blaquiere Date: Mon, 25 Oct 2021 10:18:41 +0200 Subject: [PATCH] improve: ts is already wrapped in ReuseTokenSource. Imp is now wrapped. --- google/google.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google/google.go b/google/google.go index 0465d19..bf5e432 100644 --- a/google/google.go +++ b/google/google.go @@ -198,10 +198,10 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar Ctx: ctx, URL: f.ServiceAccountImpersonationURL, Scopes: params.Scopes, - Ts: oauth2.ReuseTokenSource(nil, ts), + Ts: ts, Delegates: f.Delegates, } - return imp, nil + return oauth2.ReuseTokenSource(nil, imp), nil case "": return nil, errors.New("missing 'type' field in credentials") default: