mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 03:20:54 +00:00
ignore NilErr
This commit is contained in:
parent
79b66ef053
commit
44bdf1df63
@ -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{})
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user