golang.org/x/oauth2@v0.18.0/google/appengine_gen2_flex.go (about)

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