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

Unified Diff: service/datastore/index.go

Issue 1378613003: Fix bugs in service/datastore (Closed) Base URL: https://github.com/luci/gae.git@add_has_ancestor
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
Index: service/datastore/index.go
diff --git a/service/datastore/index.go b/service/datastore/index.go
index db49d2fe85b08814dd81de8e0e1f055dc8ac7153..fe0ca4fd4fd67d7007ecd705a0546bb1a8b88ead 100644
--- a/service/datastore/index.go
+++ b/service/datastore/index.go
@@ -217,7 +217,7 @@ func (id *IndexDefinition) Builtin() bool {
//
// NOTE: !Builtin() does not imply Compound().
func (id *IndexDefinition) Compound() bool {
- if id.Kind == "" || len(id.SortBy) <= 1 {
+ if id.Kind == "" || id.Builtin() {
return false
}
for _, sb := range id.SortBy {
@@ -234,7 +234,7 @@ func (id *IndexDefinition) Compound() bool {
// an error.
func (id *IndexDefinition) YAMLString() (string, error) {
if id.Builtin() || !id.Compound() {
- return "", fmt.Errorf("cannot generate YAML for this IndexDefinition")
+ return "", fmt.Errorf("cannot generate YAML for %s", id)
}
ret := bytes.Buffer{}

Powered by Google App Engine
This is Rietveld 408576698