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) }