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

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

Issue 1816413002: Make ExistsMulti return a BoolList (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 9 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 | « no previous file | service/datastore/datastore_test.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 Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package datastore 5 package datastore
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "io" 9 "io"
10 "io/ioutil" 10 "io/ioutil"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 if t.Kind() != reflect.Ptr { 239 if t.Kind() != reflect.Ptr {
240 return errors.New("not a pointer") 240 return errors.New("not a pointer")
241 } 241 }
242 if t.Elem().Kind() != reflect.Struct { 242 if t.Elem().Kind() != reflect.Struct {
243 return errors.New("does not point to a struct") 243 return errors.New("does not point to a struct")
244 } 244 }
245 return nil 245 return nil
246 } 246 }
247 247
248 func (d *datastoreImpl) ExistsMulti(keys []*Key) ([]bool, error) { 248 func (d *datastoreImpl) ExistsMulti(keys []*Key) (BoolList, error) {
249 lme := errors.NewLazyMultiError(len(keys)) 249 lme := errors.NewLazyMultiError(len(keys))
250 » ret := make([]bool, len(keys)) 250 » ret := make(BoolList, len(keys))
251 i := 0 251 i := 0
252 err := d.RawInterface.GetMulti(keys, nil, func(_ PropertyMap, err error) error { 252 err := d.RawInterface.GetMulti(keys, nil, func(_ PropertyMap, err error) error {
253 if err == nil { 253 if err == nil {
254 ret[i] = true 254 ret[i] = true
255 } else if err != ErrNoSuchEntity { 255 } else if err != ErrNoSuchEntity {
256 lme.Assign(i, err) 256 lme.Assign(i, err)
257 } 257 }
258 i++ 258 i++
259 return nil 259 return nil
260 }) 260 })
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 } 432 }
433 } 433 }
434 434
435 if isRoot(currentDir) { 435 if isRoot(currentDir) {
436 return nil, fmt.Errorf("datastore: failed to find index YAML file") 436 return nil, fmt.Errorf("datastore: failed to find index YAML file")
437 } 437 }
438 438
439 currentDir = filepath.Dir(currentDir) 439 currentDir = filepath.Dir(currentDir)
440 } 440 }
441 } 441 }
OLDNEW
« no previous file with comments | « no previous file | service/datastore/datastore_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698