mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 03:50:55 +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) {
|
||||
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{})
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user