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

Unified Diff: impl/memory/testing_utils_test.go

Issue 1292913002: Split off serialization and key functions to their own packages. (Closed) Base URL: https://github.com/luci/gae.git@make_queries_better
Patch Set: rebase Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/datastore_test.go ('k') | impl/prod/datastore_key.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/testing_utils_test.go
diff --git a/impl/memory/testing_utils_test.go b/impl/memory/testing_utils_test.go
index 85a75ecc0cf3f4aafd30bff2b0e13fe2836e3f02..42089586997a7def196ccc522fddec056cc7f6d6 100644
--- a/impl/memory/testing_utils_test.go
+++ b/impl/memory/testing_utils_test.go
@@ -10,6 +10,8 @@ import (
"time"
ds "github.com/luci/gae/service/datastore"
+ "github.com/luci/gae/service/datastore/dskey"
+ "github.com/luci/gae/service/datastore/serialize"
"github.com/luci/luci-go/common/cmpbin"
)
@@ -45,9 +47,9 @@ func key(kind string, id interface{}, parent ...ds.Key) ds.Key {
}
switch x := id.(type) {
case string:
- return ds.NewKey(globalAppID, "ns", kind, x, 0, p)
+ return dskey.New(globalAppID, "ns", kind, x, 0, p)
case int:
- return ds.NewKey(globalAppID, "ns", kind, "", int64(x), p)
+ return dskey.New(globalAppID, "ns", kind, "", int64(x), p)
default:
panic(fmt.Errorf("what the %T: %v", id, id))
}
@@ -78,11 +80,11 @@ func cat(bytethings ...interface{}) []byte {
case []byte:
buf.Write(x)
case time.Time:
- ds.WriteTime(buf, x)
+ serialize.WriteTime(buf, x)
case ds.Key:
- ds.WriteKey(buf, ds.WithoutContext, x)
+ serialize.WriteKey(buf, serialize.WithoutContext, x)
case *ds.IndexDefinition:
- x.Write(buf)
+ serialize.WriteIndexDefinition(buf, *x)
default:
panic(fmt.Errorf("I don't know how to deal with %T: %#v", thing, thing))
}
« no previous file with comments | « impl/memory/datastore_test.go ('k') | impl/prod/datastore_key.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698