mirror of
https://github.com/golang/oauth2.git
synced 2025-07-21 00:00:09 +08:00
PR #341 introduce some new import `x/net/context` in parallel of PR #339 replacing them with the standard context. This quick PR rename those imports. Change-Id: I94f7edbee851a733b8a307c2ea60923dd990bdb4 GitHub-Last-Rev: fbe7944356b0741b69c075db921add044e5d3745 GitHub-Pull-Request: golang/oauth2#342 Reviewed-on: https://go-review.googlesource.com/c/146837 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
28 lines
818 B
Go
28 lines
818 B
Go
// Copyright 2018 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build !appengine
|
|
|
|
// This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible.
|
|
|
|
package google
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
"sync"
|
|
|
|
"golang.org/x/oauth2"
|
|
)
|
|
|
|
var logOnce sync.Once // only spam about deprecation once
|
|
|
|
// See comment on AppEngineTokenSource in appengine.go.
|
|
func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource {
|
|
logOnce.Do(func() {
|
|
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.")
|
|
})
|
|
return ComputeTokenSource("")
|
|
}
|