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

Unified Diff: service/datastore/properties.go

Issue 1354343002: service/datastore: misc improvements in properties.go (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: 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 | « no previous file | service/datastore/propertytype_string.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/properties.go
diff --git a/service/datastore/properties.go b/service/datastore/properties.go
index 770d19b0f2b4c1e86995f6239a0c9afe7256eb12..ade4e2e2b57de279e7c509865462ad0dd3d7c5a3 100644
--- a/service/datastore/properties.go
+++ b/service/datastore/properties.go
@@ -19,7 +19,7 @@ var (
minTime = time.Unix(int64(math.MinInt64)/1e6, (int64(math.MinInt64)%1e6)*1e3)
maxTime = time.Unix(int64(math.MaxInt64)/1e6, (int64(math.MaxInt64)%1e6)*1e3)
- utcTestTime = time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC)
+ utcTestTime = time.Unix(0, 0)
)
// IndexSetting indicates whether or not a Property should be indexed by the
@@ -94,6 +94,8 @@ type PropertyConverter interface {
// automatically, using the type of the destination field to cast.
type PropertyType byte
+//go:generate stringer -type=PropertyType
iannucci 2015/09/19 18:23:26 is stringer automatically included with go, or doe
Vadim Sh. 2015/09/19 20:03:59 Our env includes it: $ which stringer /Users/vadim
+
// These constants are in the order described by
// https://cloud.google.com/appengine/docs/go/datastore/entities#Go_Value_type_ordering
// with a slight divergence for the Int/Time split.
@@ -169,33 +171,6 @@ func init() {
}
}
-func (t PropertyType) String() string {
- switch t {
- case PTNull:
- return "PTNull"
- case PTInt:
- return "PTInt"
- case PTTime:
- return "PTTime"
- case PTBool:
- return "PTBool"
- case PTBytes:
- return "PTBytes"
- case PTString:
- return "PTString"
- case PTFloat:
- return "PTFloat"
- case PTGeoPoint:
- return "PTGeoPoint"
- case PTKey:
- return "PTKey"
- case PTBlobKey:
- return "PTBlobKey"
- default:
- return fmt.Sprintf("PTUnknown(%02x)", byte(t))
- }
-}
-
// Property is a value plus an indicator of whether the value should be
// indexed. Name and Multiple are stored in the PropertyMap object.
type Property struct {
@@ -319,7 +294,7 @@ func UpconvertUnderlyingType(o interface{}) interface{} {
// an error).
func (p *Property) Value() interface{} { return p.value }
-// IndexSetting says weather or not the datastore should create indicies for
+// IndexSetting says whether or not the datastore should create indicies for
// this value.
func (p *Property) IndexSetting() IndexSetting { return p.indexSetting }
« no previous file with comments | « no previous file | service/datastore/propertytype_string.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698