minor change
This commit is contained in:
parent
ebe1360dc0
commit
d26e17dba7
@ -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{
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user