mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 20:00:54 +00:00
fix the nil judge
This commit is contained in:
parent
77e1f26dd4
commit
b1b4dbb0e4
2
cache/README.md
vendored
2
cache/README.md
vendored
@ -22,7 +22,7 @@ First you must import it
|
|||||||
|
|
||||||
Then init a Cache (example with memory adapter)
|
Then init a Cache (example with memory adapter)
|
||||||
|
|
||||||
bm, err := NewCache("memory", `{"interval":60}`)
|
bm, err := cache.NewCache("memory", `{"interval":60}`)
|
||||||
|
|
||||||
Use it like this:
|
Use it like this:
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ func getFieldType(val reflect.Value) (ft int, err error) {
|
|||||||
case reflect.String:
|
case reflect.String:
|
||||||
ft = TypeCharField
|
ft = TypeCharField
|
||||||
default:
|
default:
|
||||||
if elm == nil {
|
if elm.IsNil() {
|
||||||
panic(fmt.Errorf("%s is nil pointer, may be miss setting tag", val))
|
panic(fmt.Errorf("%s is nil pointer, may be miss setting tag", val))
|
||||||
}
|
}
|
||||||
switch elm.Interface().(type) {
|
switch elm.Interface().(type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user