datastore: fix compilation errors in doc examples
Change-Id: I8c95dc25f042e2f5f310fcf9411b20ba179a826e
diff --git a/datastore/doc.go b/datastore/doc.go
index 92ffe6d..9bfd61b 100644
--- a/datastore/doc.go
+++ b/datastore/doc.go
@@ -200,7 +200,7 @@
func (x *CustomPropsExample) Save() ([]datastore.Property, error) {
// Validate the Sum field.
if x.Sum != x.I + x.J {
- return errors.New("CustomPropsExample has inconsistent sum")
+ return nil, errors.New("CustomPropsExample has inconsistent sum")
}
// Save I and J as usual. The code below is equivalent to calling
// "return datastore.SaveStruct(x)", but is done manually for
@@ -214,7 +214,7 @@
Name: "J",
Value: int64(x.J),
},
- }
+ }, nil
}
The *PropertyList type implements PropertyLoadSaver, and can therefore hold an
@@ -343,7 +343,7 @@
continue
}
for p, rep := range props {
- fmt.Fprintf(w, "\t-%s (%s)\n", p, strings.Join(", ", rep))
+ fmt.Fprintf(w, "\t-%s (%s)\n", p, strings.Join(rep, ", "))
}
}
}