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

Unified Diff: service/datastore/raw_interface.go

Issue 1516173002: Fix error message from KeyForObj when passing an invalid struct. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: remove accidental extra test Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: service/datastore/raw_interface.go
diff --git a/service/datastore/raw_interface.go b/service/datastore/raw_interface.go
index 5d4fca391a285e0f2d2e6ff73fb28e829395eb4c..eb7533f3775036af9d76efc1b576af407fd9439c 100644
--- a/service/datastore/raw_interface.go
+++ b/service/datastore/raw_interface.go
@@ -52,8 +52,7 @@ type DeleteMultiCB func(err error)
type nullMetaGetterType struct{}
-func (nullMetaGetterType) GetMeta(string) (interface{}, error) { return nil, ErrMetaFieldUnset }
-func (nullMetaGetterType) GetMetaDefault(_ string, dflt interface{}) interface{} { return dflt }
+func (nullMetaGetterType) GetMeta(string) (interface{}, bool) { return nil, false }
var nullMetaGetter MetaGetter = nullMetaGetterType{}
@@ -78,17 +77,10 @@ func NewMultiMetaGetter(data []PropertyMap) MultiMetaGetter {
// GetMeta is like PropertyLoadSaver.GetMeta, but it also takes an index
// indicating which slot you want metadata for. If idx isn't there, this
// returns (nil, ErrMetaFieldUnset).
-func (m MultiMetaGetter) GetMeta(idx int, key string) (interface{}, error) {
+func (m MultiMetaGetter) GetMeta(idx int, key string) (interface{}, bool) {
return m.GetSingle(idx).GetMeta(key)
}
-// GetMetaDefault is like PropertyLoadSaver.GetMetaDefault, but it also takes an
-// index indicating which slot you want metadata for. If idx isn't there, this
-// returns dflt.
-func (m MultiMetaGetter) GetMetaDefault(idx int, key string, dflt interface{}) interface{} {
- return m.GetSingle(idx).GetMetaDefault(key, dflt)
-}
-
// GetSingle gets a single MetaGetter at the specified index.
func (m MultiMetaGetter) GetSingle(idx int) MetaGetter {
if idx >= len(m) || m[idx] == nil {

Powered by Google App Engine
This is Rietveld 408576698