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

Unified Diff: service/datastore/index.go

Issue 1359963003: Fix minor bug in ParseIndexColumn (Closed) Base URL: https://github.com/luci/gae.git@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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/index.go
diff --git a/service/datastore/index.go b/service/datastore/index.go
index 4c2af0779146b8fe8d2827f90efcf2efe4e4c914..d06bd9067f2a9f06991ca6559c3a4745896c7f15 100644
--- a/service/datastore/index.go
+++ b/service/datastore/index.go
@@ -24,6 +24,7 @@ type IndexColumn struct {
// `+Field` is invalid. `` is invalid.
func ParseIndexColumn(spec string) (IndexColumn, error) {
col := IndexColumn{}
+ spec = strings.TrimSpace(spec)
if strings.HasPrefix(spec, "-") {
col.Descending = true
col.Property = strings.TrimSpace(spec[1:])
@@ -33,7 +34,7 @@ func ParseIndexColumn(spec string) (IndexColumn, error) {
col.Property = strings.TrimSpace(spec)
}
if col.Property == "" {
- return col, fmt.Errorf("datastore: empty order")
+ return col, fmt.Errorf("datastore: empty order: %q", spec)
}
return col, nil
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698