Skip to content

Commit

Permalink
docs(spanner): fix the result handling after BufferWrite (#3803)
Browse files Browse the repository at this point in the history
  • Loading branch information
sryoya committed Mar 31, 2021
1 parent 88cf097 commit a93eddc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions spanner/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,10 @@ of the transaction:
}
balance -= 10
m := spanner.Update("Accounts", []string{"user", "balance"}, []interface{}{"alice", balance})
txn.BufferWrite([]*spanner.Mutation{m})
// The buffered mutation will be committed. If the commit
// fails with an Aborted error, this function will be called
// again.
return nil
return txn.BufferWrite([]*spanner.Mutation{m})
})
Expand Down
2 changes: 1 addition & 1 deletion spanner/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ func ExampleClient_ReadWriteTransaction() {
}
balance -= 10
m := spanner.Update("Accounts", []string{"user", "balance"}, []interface{}{"alice", balance})
return txn.BufferWrite([]*spanner.Mutation{m})
// The buffered mutation will be committed. If the commit fails with an
// IsAborted error, this function will be called again.
return txn.BufferWrite([]*spanner.Mutation{m})
})
if err != nil {
// TODO: Handle error.
Expand Down

0 comments on commit a93eddc

Please sign in to comment.