1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 05:40:54 +00:00

ignore NilErr

This commit is contained in:
astaxie 2017-04-30 23:38:48 +08:00
parent 79b66ef053
commit 44bdf1df63
2 changed files with 4 additions and 11 deletions

View File

@ -113,13 +113,10 @@ func (lp *Provider) SessionInit(maxlifetime int64, savePath string) error {
func (lp *Provider) SessionRead(sid string) (session.Store, error) { func (lp *Provider) SessionRead(sid string) (session.Store, error) {
var ( var (
kv map[interface{}]interface{} kv map[interface{}]interface{}
kvs []byte
err error err error
) )
if kvs, err = c.Get([]byte(sid)); err != nil { kvs, _ := c.Get([]byte(sid))
return nil, err
}
if len(kvs) == 0 { if len(kvs) == 0 {
kv = make(map[interface{}]interface{}) kv = make(map[interface{}]interface{})

View File

@ -176,16 +176,12 @@ func (rp *Provider) SessionRead(sid string) (session.Store, error) {
c := rp.poollist.Get() c := rp.poollist.Get()
defer c.Close() defer c.Close()
var ( var kv map[interface{}]interface{}
kv map[interface{}]interface{}
kvs string
err error
)
if kvs, err = redis.String(c.Do("GET", sid)); err != nil { kvs, err := redis.String(c.Do("GET", sid))
if err != redis.ErrNil {
return nil, err return nil, err
} }
if len(kvs) == 0 { if len(kvs) == 0 {
kv = make(map[interface{}]interface{}) kv = make(map[interface{}]interface{})
} else { } else {