Merge branch 'master' into merge-qa
diff --git a/.github/workflows/ci-v2.yaml b/.github/workflows/ci-v2.yaml
index f76cd08..47295f1 100644
--- a/.github/workflows/ci-v2.yaml
+++ b/.github/workflows/ci-v2.yaml
@@ -11,7 +11,7 @@
runs-on: ubuntu-latest
strategy:
matrix:
- go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x']
+ go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x']
env:
working-directory: ./v2
@@ -76,7 +76,7 @@
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Set up Cloud SDK
- uses: google-github-actions/setup-gcloud@master
+ uses: google-github-actions/setup-gcloud@v0
- name: Install
working-directory: ${{env.working-directory}}
env:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a9a7aa1..ff05a20 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,6 +12,7 @@
strategy:
matrix:
go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x']
+
steps:
- name: Set up Go
uses: actions/setup-go@v2
@@ -69,7 +70,7 @@
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Set up Cloud SDK
- uses: google-github-actions/setup-gcloud@master
+ uses: google-github-actions/setup-gcloud@v0
- name: Install
env:
GO111MODULE: off
diff --git a/README.md b/README.md
index c0cf5cc..4e3f50f 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@
* `appengine/socket` is not required on App Engine flexible environment / Managed VMs.
Use the standard `net` package instead.
-## Key Encode/Decode compatibiltiy to help with datastore library migrations
+## Key Encode/Decode compatibility to help with datastore library migrations
Key compatibility updates have been added to help customers transition from google.golang.org/appengine/datastore to cloud.google.com/go/datastore.
The `EnableKeyConversion` enables automatic conversion from a key encoded with cloud.google.com/go/datastore to google.golang.org/appengine/datastore key type.
diff --git a/v2/delay/delay.go b/v2/delay/delay.go
index 7194b6c..008cb10 100644
--- a/v2/delay/delay.go
+++ b/v2/delay/delay.go
@@ -5,28 +5,38 @@
/*
Package delay provides a way to execute code outside of the scope of
a user request by using the Task Queue API.
+
To use a deferred function, you must register the function to be
deferred as a top-level var. For example,
+
```
var laterFunc = delay.MustRegister("key", myFunc)
+
func myFunc(ctx context.Context, a, b string) {...}
```
+
You can also inline with a function literal:
+
```
var laterFunc = delay.MustRegister("key", func(ctx context.Context, a, b string) {...})
```
+
In the above example, "key" is a logical name for the function.
The key needs to be globally unique across your entire application.
+
To invoke the function in a deferred fashion, call the top-level item:
+
```
laterFunc(ctx, "aaa", "bbb")
```
+
This will queue a task and return quickly; the function will be actually
run in a new request. The delay package uses the Task Queue API to create
tasks that call the reserved application path "/_ah/queue/go/delay".
This path may only be marked as "login: admin" or have no access
restriction; it will fail if marked as "login: required".
*/
+
package delay // import "google.golang.org/appengine/v2/delay"
import (