Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gae): delete old region tags from transactions.go #5197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docs/appengine/datastore/transactions/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

// [START gae_datastore_using_transactions]
// [START using_transactions]

package counter

Expand Down Expand Up @@ -61,11 +60,9 @@ func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Current count: %d", count.Count)
}

// [END using_transactions]
// [END gae_datastore_using_transactions]

// [START gae_datastore_uses_for_transactions_1]
// [START uses_for_transactions_1]
func increment(ctx context.Context, key *datastore.Key) error {
return datastore.RunInTransaction(ctx, func(ctx context.Context) error {
count := new(Counter)
Expand All @@ -78,11 +75,9 @@ func increment(ctx context.Context, key *datastore.Key) error {
}, nil)
}

// [END uses_for_transactions_1]
// [END gae_datastore_uses_for_transactions_1]

// [START gae_datastore_uses_for_transactions_2]
// [START uses_for_transactions_2]
type Account struct {
Address string
Phone string
Expand All @@ -103,13 +98,11 @@ func GetOrUpdate(ctx context.Context, id, addr, phone string) error {
}, nil)
}

// [END uses_for_transactions_2]
// [END gae_datastore_uses_for_transactions_2]

func example() {
var ctx context.Context
// [START gae_datastore_transactional_task_enqueuing]
// [START transactional_task_enqueuing]
datastore.RunInTransaction(ctx, func(ctx context.Context) error {
t := &taskqueue.Task{Path: "/path/to/worker"}
if _, err := taskqueue.Add(ctx, t, ""); err != nil {
Expand All @@ -118,6 +111,5 @@ func example() {
// ...
return nil
}, nil)
// [END transactional_task_enqueuing]
// [END gae_datastore_transactional_task_enqueuing]
}
Loading