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

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

Issue 1667403003: Add support for uint8, uint16 and uint32 in luci/gae (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: allow negative Created 4 years, 10 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/pls_test.go ('k') | service/datastore/properties_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 "bytes" 8 "bytes"
9 "encoding/base64" 9 "encoding/base64"
10 "errors" 10 "errors"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 func UpconvertUnderlyingType(o interface{}) interface{} { 297 func UpconvertUnderlyingType(o interface{}) interface{} {
298 if o == nil { 298 if o == nil {
299 return o 299 return o
300 } 300 }
301 301
302 v := reflect.ValueOf(o) 302 v := reflect.ValueOf(o)
303 t := v.Type() 303 t := v.Type()
304 switch v.Kind() { 304 switch v.Kind() {
305 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.In t64: 305 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.In t64:
306 o = v.Int() 306 o = v.Int()
307 case reflect.Uint8, reflect.Uint16, reflect.Uint32:
308 o = int64(v.Uint())
307 case reflect.Bool: 309 case reflect.Bool:
308 o = v.Bool() 310 o = v.Bool()
309 case reflect.String: 311 case reflect.String:
310 if t != typeOfBSKey { 312 if t != typeOfBSKey {
311 o = v.String() 313 o = v.String()
312 } 314 }
313 case reflect.Float32, reflect.Float64: 315 case reflect.Float32, reflect.Float64:
314 o = v.Float() 316 o = v.Float()
315 case reflect.Slice: 317 case reflect.Slice:
316 if t.Elem().Kind() == reflect.Uint8 { 318 if t.Elem().Kind() == reflect.Uint8 {
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 if string(s) == string(t) { 982 if string(s) == string(t) {
981 return 0, true 983 return 0, true
982 } 984 }
983 if string(s) < string(t) { 985 if string(s) < string(t) {
984 return -1, true 986 return -1, true
985 } 987 }
986 return 1, true 988 return 1, true
987 } 989 }
988 return 0, false 990 return 0, false
989 } 991 }
OLDNEW
« no previous file with comments | « service/datastore/pls_test.go ('k') | service/datastore/properties_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698