1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 00:00:40 +00:00

fix the nil judge

This commit is contained in:
astaxie
2014-08-08 12:02:44 +08:00
parent 77e1f26dd4
commit b1b4dbb0e4
2 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ func getFieldType(val reflect.Value) (ft int, err error) {
case reflect.String:
ft = TypeCharField
default:
if elm == nil {
if elm.IsNil() {
panic(fmt.Errorf("%s is nil pointer, may be miss setting tag", val))
}
switch elm.Interface().(type) {