1// Copyright 2018 The Go Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// +build !appengine 6 7// This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible. 8 9package google 10 11import ( 12 "context" 13 "log" 14 "sync" 15 16 "golang.org/x/oauth2" 17) 18 19var logOnce sync.Once // only spam about deprecation once 20 21// See comment on AppEngineTokenSource in appengine.go. 22func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { 23 logOnce.Do(func() { 24 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.") 25 }) 26 return ComputeTokenSource("") 27} 28