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

Side by Side Diff: service/datastore/multiarg.go

Issue 2342063003: Differentiate between single- and multi- props. (Closed)
Patch Set: Slice is now always a clone. This is marginally worse performance, but a much safer UI. Created 4 years, 3 months 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 | « service/datastore/meta/eg_test.go ('k') | service/datastore/pls_impl.go » ('j') | 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 datastore 5 package datastore
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "reflect" 9 "reflect"
10 10
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // 282 //
283 // GetMeta will be implemented, returning the *Key for the "key" meta. 283 // GetMeta will be implemented, returning the *Key for the "key" meta.
284 // 284 //
285 // If slot is addressable, SetMeta will allow it to be set to the supplied 285 // If slot is addressable, SetMeta will allow it to be set to the supplied
286 // Value. 286 // Value.
287 type keyMGS struct { 287 type keyMGS struct {
288 slot reflect.Value 288 slot reflect.Value
289 } 289 }
290 290
291 func (mgs *keyMGS) GetAllMeta() PropertyMap { 291 func (mgs *keyMGS) GetAllMeta() PropertyMap {
292 » return PropertyMap{"$key": []Property{MkPropertyNI(mgs.slot.Interface()) }} 292 » return PropertyMap{"$key": MkPropertyNI(mgs.slot.Interface())}
293 } 293 }
294 294
295 func (mgs *keyMGS) GetMeta(key string) (interface{}, bool) { 295 func (mgs *keyMGS) GetMeta(key string) (interface{}, bool) {
296 if key != "key" { 296 if key != "key" {
297 return nil, false 297 return nil, false
298 } 298 }
299 return mgs.slot.Interface(), true 299 return mgs.slot.Interface(), true
300 } 300 }
301 301
302 func (mgs *keyMGS) SetMeta(key string, value interface{}) bool { 302 func (mgs *keyMGS) SetMeta(key string, value interface{}) bool {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 default: 565 default:
566 // Pass through to track as MultiError. 566 // Pass through to track as MultiError.
567 bt.errorTracker.trackError(it, err) 567 bt.errorTracker.trackError(it, err)
568 } 568 }
569 } 569 }
570 570
571 func (bt *boolTracker) result() *ExistsResult { 571 func (bt *boolTracker) result() *ExistsResult {
572 bt.res.updateSlices() 572 bt.res.updateSlices()
573 return &bt.res 573 return &bt.res
574 } 574 }
OLDNEW
« no previous file with comments | « service/datastore/meta/eg_test.go ('k') | service/datastore/pls_impl.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698