1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 11:10:40 +00:00

fix ineffectual

This commit is contained in:
astaxie
2017-04-28 22:36:28 +08:00
parent 3e29078f68
commit aa8f7bc146
14 changed files with 35 additions and 22 deletions

View File

@ -162,7 +162,9 @@ func (cp *Provider) SessionRead(sid string) (session.Store, error) {
)
err = cp.b.Get(sid, &doc)
if doc == nil {
if err != nil {
return nil, err
} else if doc == nil {
kv = make(map[interface{}]interface{})
} else {
kv, err = session.DecodeGob(doc)

View File

@ -74,8 +74,7 @@ func TestCookieEncodeDecode(t *testing.T) {
if err != nil {
t.Fatal("encodeCookie:", err)
}
dst := make(map[interface{}]interface{})
dst, err = decodeCookie(block, hashKey, securityName, str, 3600)
dst, err := decodeCookie(block, hashKey, securityName, str, 3600)
if err != nil {
t.Fatal("decodeCookie", err)
}