From 079993b9f722f17d0521fe6e2be4850d7b158d22 Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 6 Jul 2015 13:54:14 +0800 Subject: [PATCH] fix #1245 --- context/input.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/context/input.go b/context/input.go index 1985df21..c8a8aaa9 100644 --- a/context/input.go +++ b/context/input.go @@ -353,7 +353,7 @@ func (input *BeegoInput) Bind(dest interface{}, key string) error { } func (input *BeegoInput) bind(key string, typ reflect.Type) reflect.Value { - rv := reflect.Zero(reflect.TypeOf(0)) + rv := reflect.Zero(typ) switch typ.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: val := input.Query(key) @@ -398,7 +398,7 @@ func (input *BeegoInput) bind(key string, typ reflect.Type) reflect.Value { } func (input *BeegoInput) bindValue(val string, typ reflect.Type) reflect.Value { - rv := reflect.Zero(reflect.TypeOf(0)) + rv := reflect.Zero(typ) switch typ.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: rv = input.bindInt(val, typ)