From d26e17dba761fd5f0ead2c3402d64b7fc61087b4 Mon Sep 17 00:00:00 2001 From: Darko Luketic Date: Sun, 12 Feb 2017 17:13:08 +0100 Subject: [PATCH] minor change --- wiki/storage/mongo/storage.go | 4 ++-- wiki/template/renderer.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wiki/storage/mongo/storage.go b/wiki/storage/mongo/storage.go index 6209b7f..d5165c9 100644 --- a/wiki/storage/mongo/storage.go +++ b/wiki/storage/mongo/storage.go @@ -9,7 +9,7 @@ import ( const ( databaseDefault = "wiki" termCollectionDefault = "term" - RevisionCollectionDefault = "revision" + revisionCollectionDefault = "revision" ) type mongoStorage struct { @@ -33,7 +33,7 @@ func New(ms *mgo.Session, config Config) mongoStorage { config.TermCollection = termCollectionDefault } if config.RevisionCollection == "" { - config.RevisionCollection = RevisionCollectionDefault + config.RevisionCollection = revisionCollectionDefault } return mongoStorage{ diff --git a/wiki/template/renderer.go b/wiki/template/renderer.go index f73fd53..df00826 100644 --- a/wiki/template/renderer.go +++ b/wiki/template/renderer.go @@ -45,7 +45,9 @@ func (r *Renderer) Render(w io.Writer, name string, data interface{}) error { } ctx, ok := data.(map[string]interface{}) if !ok { - return errors.New("data is compatible with map[string]interface{}") + if data != nil { + return errors.New("data is not compatible with map[string]interface{}") + } } return t.ExecuteWriter(ctx, w) }