Adding support for boolean params

This commit is contained in:
spf13
2014-01-28 23:24:59 -05:00
parent 1da3fd039a
commit 1882ffabc6
2 changed files with 8 additions and 0 deletions

View File

@@ -412,6 +412,8 @@ func (page *Page) update(f interface{}) error {
default:
// If not one of the explicit values, store in Params
switch vv := v.(type) {
case bool:
page.Params[loki] = vv
case string:
page.Params[loki] = vv
case int64, int32, int16, int8, int:
@@ -444,6 +446,8 @@ func (page *Page) GetParam(key string) interface{} {
}
switch v.(type) {
case bool:
return interfaceToBool(v)
case string:
return interfaceToString(v)
case int64, int32, int16, int8, int: