Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: impl/memory/datastore.go

Issue 2492053003: Fix 'impl/memory' context key. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « impl/memory/context.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 10
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 func (d *txnDsImpl) Count(fq *ds.FinalizedQuery) (ret int64, err error) { 213 func (d *txnDsImpl) Count(fq *ds.FinalizedQuery) (ret int64, err error) {
214 return countQuery(fq, d.kc, true, d.data.snap, d.data.snap) 214 return countQuery(fq, d.kc, true, d.data.snap, d.data.snap)
215 } 215 }
216 216
217 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio nOptions) error { 217 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio nOptions) error {
218 return errors.New("datastore: nested transactions are not supported") 218 return errors.New("datastore: nested transactions are not supported")
219 } 219 }
220 220
221 func (d *txnDsImpl) WithoutTransaction() context.Context { 221 func (d *txnDsImpl) WithoutTransaction() context.Context {
222 » return context.WithValue(d, currentTxnKey, nil) 222 » return context.WithValue(d, &currentTxnKey, nil)
223 } 223 }
224 224
225 func (d *txnDsImpl) CurrentTransaction() ds.Transaction { 225 func (d *txnDsImpl) CurrentTransaction() ds.Transaction {
226 return d.data.txn 226 return d.data.txn
227 } 227 }
228 228
229 func (d *txnDsImpl) GetTestable() ds.Testable { return nil } 229 func (d *txnDsImpl) GetTestable() ds.Testable { return nil }
OLDNEW
« no previous file with comments | « impl/memory/context.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698