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

Unified Diff: service/datastore/pls_impl.go

Issue 1355783002: Refactor keys and queries in datastore service and implementation. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: appease errcheck Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/multiarg.go ('k') | service/datastore/pls_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/pls_impl.go
diff --git a/service/datastore/pls_impl.go b/service/datastore/pls_impl.go
index 6e2f2b651ec749616584736db01a8d46078831e7..fb39abcf167945f0cf348db29d85bf61d2e42eac 100644
--- a/service/datastore/pls_impl.go
+++ b/service/datastore/pls_impl.go
@@ -142,9 +142,6 @@ func loadInner(codec *structCodec, structValue reflect.Value, index int, name st
}
} else {
knd := v.Kind()
- if v.Type().Implements(typeOfKey) {
- knd = reflect.Interface
- }
project := PTNull
overflow := (func(interface{}) bool)(nil)
@@ -165,10 +162,10 @@ func loadInner(codec *structCodec, structValue reflect.Value, index int, name st
project = PTFloat
overflow = func(x interface{}) bool { return v.OverflowFloat(x.(float64)) }
set = func(x interface{}) { v.SetFloat(x.(float64)) }
- case reflect.Interface:
+ case reflect.Ptr:
project = PTKey
set = func(x interface{}) {
- if k, ok := x.(Key); ok {
+ if k, ok := x.(*Key); ok {
v.Set(reflect.ValueOf(k))
}
}
@@ -488,11 +485,9 @@ func getStructCodecLocked(t reflect.Type) (c *structCodec) {
st.isSlice = ft.Elem().Kind() != reflect.Uint8
c.hasSlice = c.hasSlice || st.isSlice
case reflect.Interface:
- if ft != typeOfKey {
- c.problem = me("field %q has non-concrete interface type %s",
- f.Name, f.Type)
- return
- }
+ c.problem = me("field %q has non-concrete interface type %s",
+ f.Name, f.Type)
+ return
}
}
« no previous file with comments | « service/datastore/multiarg.go ('k') | service/datastore/pls_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698