minor change

This commit is contained in:
Darko Luketic 2017-02-12 17:13:08 +01:00
parent ebe1360dc0
commit d26e17dba7
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import (
const ( const (
databaseDefault = "wiki" databaseDefault = "wiki"
termCollectionDefault = "term" termCollectionDefault = "term"
RevisionCollectionDefault = "revision" revisionCollectionDefault = "revision"
) )
type mongoStorage struct { type mongoStorage struct {
@ -33,7 +33,7 @@ func New(ms *mgo.Session, config Config) mongoStorage {
config.TermCollection = termCollectionDefault config.TermCollection = termCollectionDefault
} }
if config.RevisionCollection == "" { if config.RevisionCollection == "" {
config.RevisionCollection = RevisionCollectionDefault config.RevisionCollection = revisionCollectionDefault
} }
return mongoStorage{ return mongoStorage{

View File

@ -45,7 +45,9 @@ func (r *Renderer) Render(w io.Writer, name string, data interface{}) error {
} }
ctx, ok := data.(map[string]interface{}) ctx, ok := data.(map[string]interface{})
if !ok { 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) return t.ExecuteWriter(ctx, w)
} }