You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
818 B

  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. // +build !appengine
  5. // This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible.
  6. package google
  7. import (
  8. "context"
  9. "log"
  10. "sync"
  11. "golang.org/x/oauth2"
  12. )
  13. var logOnce sync.Once // only spam about deprecation once
  14. // See comment on AppEngineTokenSource in appengine.go.
  15. func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource {
  16. logOnce.Do(func() {
  17. 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.")
  18. })
  19. return ComputeTokenSource("")
  20. }