1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-25 13:20:49 +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) {
var (
kv map[interface{}]interface{}
kvs []byte
err error
)
if kvs, err = c.Get([]byte(sid)); err != nil {
return nil, err
}
kvs, _ := c.Get([]byte(sid))
if len(kvs) == 0 {
kv = make(map[interface{}]interface{})

View File

@ -176,16 +176,12 @@ func (rp *Provider) SessionRead(sid string) (session.Store, error) {
c := rp.poollist.Get()
defer c.Close()
var (
kv map[interface{}]interface{}
kvs string
err error
)
var kv map[interface{}]interface{}
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
}
if len(kvs) == 0 {
kv = make(map[interface{}]interface{})
} else {