From 9bb904979d93d76cf7000f77c4a1d7bc06c7a708 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 19 Feb 2021 18:54:49 -0500 Subject: [PATCH] all: go fmt ./... Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Not strictly necessary but will avoid spurious changes as files are edited. Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: I22803ea9e936fbb08984a64155302f47e181de27 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/294420 Trust: Russ Cox Trust: Cody Oss Run-TryBot: Russ Cox TryBot-Result: Go Bot Reviewed-by: Cody Oss --- google/appengine_gen1.go | 1 + google/appengine_gen2_flex.go | 1 + google/internal/externalaccount/basecredentials.go | 2 +- google/internal/externalaccount/urlcredsource_test.go | 4 ++-- internal/client_appengine.go | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/google/appengine_gen1.go b/google/appengine_gen1.go index 83dacac..16c6c6b 100644 --- a/google/appengine_gen1.go +++ b/google/appengine_gen1.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build appengine // +build appengine // This file applies to App Engine first generation runtimes (<= Go 1.9). diff --git a/google/appengine_gen2_flex.go b/google/appengine_gen2_flex.go index 04c2c22..a7e27b3 100644 --- a/google/appengine_gen2_flex.go +++ b/google/appengine_gen2_flex.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !appengine // +build !appengine // This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible. diff --git a/google/internal/externalaccount/basecredentials.go b/google/internal/externalaccount/basecredentials.go index d0ca23c..1b87c09 100644 --- a/google/internal/externalaccount/basecredentials.go +++ b/google/internal/externalaccount/basecredentials.go @@ -45,7 +45,7 @@ func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { ctx: ctx, url: c.ServiceAccountImpersonationURL, scopes: scopes, - ts: oauth2.ReuseTokenSource(nil, ts), + ts: oauth2.ReuseTokenSource(nil, ts), } return oauth2.ReuseTokenSource(nil, imp) } diff --git a/google/internal/externalaccount/urlcredsource_test.go b/google/internal/externalaccount/urlcredsource_test.go index 6874f11..8ade2a2 100644 --- a/google/internal/externalaccount/urlcredsource_test.go +++ b/google/internal/externalaccount/urlcredsource_test.go @@ -29,8 +29,8 @@ func TestRetrieveURLSubjectToken_Text(t *testing.T) { heads := make(map[string]string) heads["Metadata"] = "True" cs := CredentialSource{ - URL: ts.URL, - Format: format{Type: fileTypeText}, + URL: ts.URL, + Format: format{Type: fileTypeText}, Headers: heads, } tfc := testFileConfig diff --git a/internal/client_appengine.go b/internal/client_appengine.go index 7434871..e1755d1 100644 --- a/internal/client_appengine.go +++ b/internal/client_appengine.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build appengine // +build appengine package internal