From 923679b36c9d47deefcf079dfaf165de5f6c085d Mon Sep 17 00:00:00 2001 From: Jeremy Jay Date: Fri, 18 Jul 2014 14:54:29 -0400 Subject: [PATCH] comment tweaks --- cayley.go | 2 +- db/open.go | 3 +-- graph/triplestore.go | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cayley.go b/cayley.go index 7ff1fd8..d5dea02 100644 --- a/cayley.go +++ b/cayley.go @@ -27,7 +27,7 @@ import ( "github.com/google/cayley/graph" "github.com/google/cayley/http" - // load all supported backends + // Load all supported backends. _ "github.com/google/cayley/graph/leveldb" _ "github.com/google/cayley/graph/memstore" _ "github.com/google/cayley/graph/mongo" diff --git a/db/open.go b/db/open.go index b0973d7..6b78e52 100644 --- a/db/open.go +++ b/db/open.go @@ -26,10 +26,9 @@ func Open(cfg *config.Config) graph.TripleStore { ts, err := graph.NewTripleStore(cfg.DatabaseType, cfg.DatabasePath, cfg.DatabaseOptions) if err != nil { glog.Fatalln(err.Error()) - return nil } - // memstore is not persistent, so MUST be loaded + // Memstore is not persistent, so it MUST be loaded. if cfg.DatabaseType == "memstore" { Load(ts, cfg, cfg.DatabasePath) } diff --git a/graph/triplestore.go b/graph/triplestore.go index 76a18cc..9690bdb 100644 --- a/graph/triplestore.go +++ b/graph/triplestore.go @@ -163,9 +163,10 @@ func InitTripleStore(name, dbpath string, opts Options) error { return errors.New("triplestore: name '" + name + "' is not registered") } -func TripleStores() (t []string) { +func TripleStores() []string { + t := make([]string, 0, len(storeRegistry)) for n := range storeRegistry { t = append(t, n) } - return + return t }